How does react package without packaging configuration files using webpack?

problem description

because the development environment is different from the test environment, some configuration parameters are put into a separate file. Each package in the development environment and test environment needs to be modified and submitted separately, and then packaged, which is very troublesome.

is there any way to make the js files of these configuration classes not packaged and can still be used after packaging? you can change these files directly in different environments.

Development environment

react, webpack, dva


each environment is configured with a separate configuration file. Different environments execute different packaging commands, and different configuration files are introduced.


if (process.env.NODE_ENV = 'test') {
require (' test.config.js')
} else if (process.env.NODE_ENV = 'pro') {
require (' pro.config.js')
}


code split types the configuration into a separate js file, inevitably with some compiled code, but this is already the best solution to build on webpack .

or skip webpack, and just use script to introduce it. The only disadvantage is that the configuration is exposed to a global variable, and cannot use webpack closures

.
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-1b2b8de-2baad.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-1b2b8de-2baad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?