Single-page application, do you use webpack to package js files referenced by script tags?

single-page application, angular library files referenced by script tags and controller.js and model.js, of each module can be packaged using webpack, non-professional front end.

Thank you.

Mar.23,2021

No. Webpack is used for modular programming, and it is packaged according to dependencies.


webpack allows you to have a modular development experience, generally speaking, there is no need for you to manually introduce script files into the script element (the introduction of script files is actually more similar to the result of packaging, of course, all the code will be processed to a certain extent during the packaging process), but if you must introduce a script for global use, it is not impossible to write it in the based html.

new HtmlWebpackPlugin({template: './src/index.html'})
Menu