- Issue created by @wim leers
- First commit to issue fork.
Discovered while working on š Populate data to drupalSettings to enable Dynamic Code Components Active .
When defining a drupalSettings
-only asset library, such as:
mySettings:
dependencies:
- core/drupalSettings
drupalSettings:
myModule:
foo: null
bar: null
which is similar to how core defines its placeholder settings for the asset library definitions to be as declarative as possible:
drupalSettings:
version: VERSION
js:
# Need to specify a negative weight like drupal.js until
# https://www.drupal.org/node/1945262 is resolved.
misc/drupalSettingsLoader.js: { weight: -18 }
drupalSettings:
# These placeholder values will be set by system_js_settings_alter().
path:
baseUrl: null
pathPrefix: null
currentPath: null
currentPathIsAdmin: null
isFront: null
currentLanguage: null
pluralDelimiter: null
⦠then this doesn't work, because js
is not set, and even if it were set to js: {}
, it wouldn't work. Because AssetResolver::getJsSettingsAssets()
's
foreach ($this->getLibrariesToLoad($assets, 'js') as $library) {
should be
foreach ($this->getLibrariesToLoad($assets, 'drupalSettings') as $library) {
See above.
None.
None.
None.
None.
Pure drupalSettings
asset libraries are resolved as expected.
Active
11.2 š„
asset library system
Enhances developer experience.