Webpack introduces config

webpack

is how dev.env.js works
require (".. / config") introduces config/index.js, right?

Mar.05,2021

is actually running different commands, passing in different parameters, and using different files.
such as running npm run dev . The
actual command can be configured as node build/build.js-- env dev .
get the corresponding parameter dev in build.js , get the corresponding file and execute it.


I made it myself. Configure dev and build script, to execute different js files (or config files).

"build": "webpack prod.env.js"
"dev": "webpack-dev-server --config dev.env.js"

the two simplest script commands.

Menu