4.1 On bundling
Last updated
Last updated
The general process of bundling an Aurelia app is explained in . It may seem like for a complete bundle configuration it would be sufficient to just add the bridge to a bundle:
A problem with this approach is that the bridge does not export its components directly and thus these components are not directly visible to Aurelia bundler.
Instead, the bridge's index.js
file uses config-builder
to fill Aurelia's globalResources
(just like ).
A sufficient bundle configuration needs to include the sub-directories of the bridge as well as its html and css files. Such a configuration would look like this:
An even better solution is to only include the bridge (without its own dependencies) in a separate bundle.
Since jquery is a dependency of materialize-css, you should add it explicitly to the bundle or make sure to import it first.
If you get the error
This is probably a bug in SystemJS, where use strict
at the beginning of the bundle breaks the import.
The following solutions exists:
Just remove "use strict";
from the bundle
Don't add materialize-css to the bundle
This issue is probably gone with SystemJS 0.20/JSPM 0.17
for a complete bundle using three bundles for this catalog app, the Aurelia framework and used plugins (including Materialize bridge).
Reference: