Our front-end is developed with angular2. After compiling webpack and packaging, how is the production environment handled?
Is it enough to just put the packaged js and html files on the server? Do I need to install a front-end server in the production environment? How to deal with the angular dependencies and other dependencies such as webpack used in our development?
淡淡烟草味2017-05-16 13:22:24
After building, just throw the dist directory to the server, nginx will forward it and it’s done
PHP中文网2017-05-16 13:22:24
Static resources such as js, html, and image styles are required. node_modules need to be placed in the js and html folders or their outer layers. Webpack dependencies are not required
仅有的幸福2017-05-16 13:22:24
Package and build directly with the appropriate webpack plug-in. Considering the optimization of the project, you can use lazy loading, AOT, etc. For development, it is best to install webpack-dev-server for easy debugging. You can check out my starter when you have time
为情所困2017-05-16 13:22:24
After packaging, just put it directly on the server. Everything you depend on is included in the package