4.1 On bundling
The general process of bundling an Aurelia app is explained in the Aurelia documentation on bundling . 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 Aurelia features are configured).
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.
Have a look here for a complete bundle using three bundles for this catalog app, the Aurelia framework and used plugins (including Materialize bridge).
A note on jQuery
Since jquery is a dependency of materialize-css, you should add it explicitly to the bundle or make sure to import it first.
Troubleshooting
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 bundleDon't add materialize-css to the bundle
This issue is probably gone with SystemJS 0.20/JSPM 0.17
Reference: https://github.com/aurelia-ui-toolkits/aurelia-materialize-bridge/issues/444
Last updated