Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up angular 4 with webpack

Tags:

angular

When i create angular-project(ng new projectname), it automatically build inline.bundle.js, main.bundle.js, polyfills.bundle.js, styles.bundle.js, vender.bundle.js in dist folder. I can use the dist/index.js in backend. So my question is "Ng4 build webpack automatically?"

like image 480
Jacobys527 Avatar asked May 02 '17 17:05

Jacobys527


1 Answers

When you use angular-cli to create an angular 2 project, the project is automatically build with webpack.

Angular-cli changed from systemjs to webpack a while ago.

If you want to get the webpack configuration file you can use ng eject.

https://github.com/angular/angular-cli/wiki/eject

Edit based on comment:

There is no dependency on webpack in your angular project because angular/cli has a dependency on webpack and will install webpack for you. If you check your node_modules folder, you will see that webpack is there.

like image 79
Rick Avatar answered Oct 09 '22 01:10

Rick