You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess you would have to add another module to build:
entry: {
app: [ helpers.root('src/main.browser')],
vendor: [helpers.root('src/vendor.browser')],
polyfills: [helpers.root('src/polyfills.browser.ts')]
css: [ css files]
}, https://webpack.github.io/docs/multiple-entry-points.html
Then they would be loaded by proper loaders, minified, and injected to your html template by HtmlWebpackPlugin
Activity
karolmie1 commentedon Dec 9, 2016
Are those css files loaded by webpage? If so then according to offical docs:
https://github.com/webpack/css-loader
Minification
By default the css-loader minimizes the css if specified by the module system.
NatsuOnFire commentedon Dec 9, 2016
I have directly filled my CSS files in index.html
How to use css-loader on these files?
karolmie1 commentedon Dec 9, 2016
I guess you would have to add another module to build:
entry: {
app: [ helpers.root('src/main.browser')],
vendor: [helpers.root('src/vendor.browser')],
polyfills: [helpers.root('src/polyfills.browser.ts')]
css: [ css files]
},
https://webpack.github.io/docs/multiple-entry-points.html
Then they would be loaded by proper loaders, minified, and injected to your html template by HtmlWebpackPlugin
Does this solution work for you?
Actually it's more of stackoverflow question:
http://stackoverflow.com/questions/36225548/concat-and-minify-css-files-with-webpack-without-require-them
romelgomez commentedon Dec 9, 2016
Add material
npm install --save @angular/material material hammerjsIn the file /config/head-config.common.js, Add to the link array:
In the app Module /src/app/app.module.ts or in the Module where material will work add:
Resources:
Add sass support
npm install --save-dev node-sass sass-loaderIn the file /config/webpack.common.js, Add to return object of Webpack configuration function, to module.rules array
Replace in the component decorator declaration the .css files for .scss
Ref:
romelgomez commentedon Dec 9, 2016
In the app.component.scss add this for Material
romelgomez commentedon Dec 9, 2016
And for Font Awesome:
#1118
NatsuOnFire commentedon Dec 9, 2016
@karolmie1
Yes, that's what I want to implement as a solution.
@romelgomez
I don't use Material but Materialize with angular2-materialize. On the other hand, I will use the solution for Font Awesome, thanks.
kodeine commentedon Dec 17, 2016
angular2-materializelooks way better thanmaterial2which was being used in this starter before.romelgomez commentedon Dec 17, 2016
@kodeine See these examples codes: https://github.com/angular/material2/tree/master/src/demo-app
Add material to angular2-webpack-starter in three steps
Also, see this project before take your decision: https://github.com/Teradata/covalent