13
votes

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?

3
i think if you want to use webpack you need to use an angular-cli webpack plugin .. angular cli is not very mature at the momentfederico scamuzzi
but as far as I know, angular-cli already uses webpack, that's what they say in the documentationDavid
yesbut i think you need a plugin to manage it .. i thinkfederico scamuzzi
Maybe this helps. Thanks.Salman Kazmi

3 Answers

12
votes

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

7
votes

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.

1
votes

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.