Skip to content

Commit 98aec70

Browse files
committed
chore(readme): Updated readme - added webpack setup
1 parent 6e74a3b commit 98aec70

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,44 @@ The [Materialize](https://github.com/InfomediaLtd/angular2-materialize/blob/mast
7979
</div>
8080
```
8181

82-
#### Installing angular2-materialize with JSPM
82+
#### Installing and configuring angular2-materialize with webpack
83+
84+
Install MaterializeCSS and angular2-materialize from npm
85+
```sh
86+
npm install materialize-css --save
87+
npm install angular2-materialize --save
88+
```
89+
90+
Add the Google MD fonts to your index.html:
91+
```html
92+
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
93+
```
94+
95+
Add the following aliases and loader to your webpack configuration:
96+
```js
97+
module.exports = {
98+
//...
99+
resolve: {
100+
alias: {
101+
materializecss: 'materialize-css/dist/css/materialize.css',
102+
materialize: 'materialize-css/dist/js/materialize.js',
103+
//...
104+
},
105+
module: {
106+
loaders: [
107+
{
108+
test: /materialize-css\/dist\/js\/materialize\.js/,
109+
loader: 'imports?materializecss'
110+
},
111+
//...
112+
]
113+
}
114+
//...
115+
};
116+
```
117+
Notice that the imports loader is required for this setup.
118+
119+
#### Installing and configuring angular2-materialize with jspm
83120

84121
Install MaterializeCSS, by providing overrides for its dependencies:
85122
```sh

0 commit comments

Comments
 (0)