The Problem: I am trying to get the materialize.css work with the Aurelia CLI. But what i get is the whole materialize.js as an error output in the console and a part of the hammerjs as well i think.
What i've done The Aurelia cli compiles fine with the follwing lines in the aurelia.json:
"jquery",
{
"name": "hammerjs",
"path": "../node_modules/hammerjs",
"main": "hammer",
"deps": ["jquery"]
},
{
"name": "materialize",
"path": "../node_modules/materialize-css/dist",
"main": "js/materialize",
"deps": ["jquery", "hammerjs"],
"resources": [
"css/materialize.css"
]
},
Maybe i am missing something here. I thought this must be as simple as the implementation of bootstrap, but i guess i was damn wrong.
Solved it so far. The problem is the implementation of the materialize.js in the dist folder. The *.js files in there are not compatible with the aurelia build system.
Easiest way is to change the aurelia.json as followed:
{
"name": "materialize",
"path": "../node_modules/materialize-css",
"main": "js/materialize",
"deps": ["jquery", "hammerjs"]
},
Finally bind the css files for materialize.css via the cdn that is provided. Thats the best solution i've got so far.
Any better solutions are welcome.
/edit
Seems like this is not properly working either. As soon as you try to invoke materialize functions, you get errors over errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With