Answer the question
In order to leave comments, you need to log in
How to run two webpack servers from one folder?
How to specify in package.json that you need to run a command from a specific config? Let's say in the root directory of the project there will be two configs.
Answer the question
In order to leave comments, you need to log in
The principle is this:
1) learn how to run webpack with the necessary config
hint:
2) enter in package.json in the scripts section, for example:
then npm run server1
ps in the scripts section, you can enter any command that you can execute in the terminal.
in webpack.config.js
switch (process.env.NODE_ENV) {
case 'prod':
case 'production':
module.exports = require('./config/webpack.prod');
break;
case 'test':
case 'testing':
module.exports = require('./config/webpack.test');
break;
case 'dev':
case 'development':
default:
module.exports = require('./config/webpack.dev');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question