-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to minify CSS in assets? #1232
Comments
Are those css files loaded by webpage? If so then according to offical docs: Minification |
I have directly filled my CSS files in index.html
How to use css-loader on these files? |
I guess you would have to add another module to build: 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: |
Add material
In 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: // Material 2
import { MaterialModule } from '@angular/material';
import 'hammerjs'; imports: [
MaterialModule.forRoot()
], Resources: Add sass support
In 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: |
In the app.component.scss add this for Material
|
And for Font Awesome: |
@karolmie1 @romelgomez |
|
@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 |
Hi,
I would like to know how to minify CSS files in assets directory?
Thanks
The text was updated successfully, but these errors were encountered: