materialize-loader
Materialize configuration and loading package for webpack 2, using materialize-css (Sass).
Based on bootstrap-webpack by Scott Bleck (@bline) and font-awesome-webpack by Gowrav Shekar (@gowravshekar).
Usage
To properly load materialize-css, you need to configure loaders in your webpack.config.js
. Example:
moduleexports =module:loaders:test: /\.woff??$/ loader: 'url-loader?limit=10000&mimetype=application/font-woff'test: /\.?$/ loader: 'file-loader';
Don't forget to install appropriated loaders
npm install --save-dev url-loader file-loader
Complete Materialize
To use the complete Materialize package including all styles with the default settings:
;
Custom configuration
You can configurate materialize-loader with two configuration files:
materialize.config.js
materialize.config.scss
Add both files next to each other in your project. Then:
;
Or simple add it as entry point to your webpack.config.js
:
moduleexports =entry:'materialize-loader!./path/to/materialize.config.js''your-existing-entry-point';
materialize.config.js
Example:
moduleexports =styles:'materialize': true;
materialize.config.scss
Imported after Materialize's default variables, but before anything else.
You may customize Materialize here.
Example:
;;;