-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Description
use @angular-builders/custom-webpack to export webpack.config.js hook,src/styles.css can't build with ng build --prod
. @angular/cli version is @angular/cli": "~8.2.2
, even i test latest.
styles has no name and no file. this is simple code of webpack.config.js
`
const path = require('path');
module.exports = (config, options) => {
config.plugins.push(spritePlugin);
config.module.rules = config.module.rules.filter(
rule => rule.test.toString() !== '/\\.css$/'
);
// CSS Module support
config.module.rules.push({
test: /\.(css)$/,
use: [
'style-loader',
'css-loader',
],
});
return config
};
`
code can't run with ng build --prod
,to fix the problem i use ng build --extract-css=false
, but lose some of performance. export webpack config, we can do more things like use postcss...
Metadata
Metadata
Assignees
Labels
No labels