CodeCoupler Webpack Externals Plugin Dynamically load assets
If you want to load stylesheets, scripts or other assets dynamically in your code you have to know
the path to the copied files. Because the path include amongst other things the version number this
can not be determined easily. Therefore the plugin will inject a global variable externalsPath
1 where you can read the needed path.
The variable holds an array where the key is the module name. If you use an alias, the alias name will be used. For each key the corresponding value is the relative path from the root of your application to the root of the module.
Example:
-
Till version 3.2 the variablename was
window.ccExternals
without the sub-property["module-name"]
. Till version 3.3 the variablename waswindow.ccExternals
. ↩