How does vue+webpack realize the packaging and switching of development, testing, production and other environments?

projects built by vue-cli+webpack. Npm run build has to manually distinguish between test and production environments every time it is packaged. How to configure automatic differentiation? For example, I need to distinguish between assetsPublicPath:"/", the packaged path is different, the api of the proxy proxy is different, and so on. Ask the great god for advice. Thank you


npm provides a npm_lifecycle_event variable that returns the name of the currently running script

The most common use of

DefinePlugin is to deal with the differences between our development and production environments.

you can use both

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9f81b-1a5f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9f81b-1a5f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?