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?
After building, just throw the dist directory to the server, nginx will forward it and it’s done
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
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
After packaging, just put it directly on the server. Everything you depend on is included in the package