Where is the webpack.config.js in angular-cli new

2019-04-04 09:20发布

问题:

I'm looking into webpack and also angular-cli, and even though angular-cli is supposed to use webpack, I can't see any webpack.config.js file when I create a new project with ng new

Does anybody know how does this work in angular-cli?

回答1:

I found this thread about configuring webpack in angular-cli. It seems webpack is not configureable at the moment, but they are working on it.



回答2:

You can use $ ng eject to generate webpack.config.js in the root folder of your project.



回答3:

It's not possible to edit webpack in angular-cli project.
There is a workaround repo. Hope this might help. here. Or you can use a scaffolder too if you do it too often https://www.npmjs.com/package/es6-scaffolder. Just choose the angular 2 webpack scaffold from the options.