简体   繁体   中英

How to bundle js files in “dist” folder (angular 7)?

I am running an angular 7 web application that has a dist folder with bunch of java script files that are not bundled. I would like to bundle all the java script file inside the dist folder in one java script file to minimize the http request when I load my web page

I have tried the following:

npm run build --aot --buildOptimizer --prod

I am expecting to see bundled files in dist folder

Your files will not be bundled to a single file. At least several files will be available like main.js , vendor.js etc.

However, if you want to pass building options like --aot you have to run

ng build --aot --prod

npm run build will run exactly the command defined in package.json .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM