L
L
lavezzi12016-08-24 14:09:16
JavaScript
lavezzi1, 2016-08-24 14:09:16

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

2 answer(s)
M
Maxim, 2016-08-24
@maxfarseer

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.

V
vvkovaliov, 2016-08-26
@vvkovaliov

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');
}

and run with keys.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question