I have a project, which consists of two parts.. an admin environment and a part of web for regular users. Each part has another assets, so I have two configurations for webpack. First is named webpack-front.config.js and second is named webpack-admin.config.js.
My structure:
├─┬ dist
│ ├── front.bundle.js
│ └── admin.bundle.js
|
├─┬ src
│ ├─┬ front
| | └── index.js
│ └─┬ admin
| └── index.js
Problem starts, when I try to run "webpack-dev-server --open". Npm prints:
> webpack-dev-server --open
No configuration file found and no entry configured via CLI option.
When using the CLI you need to provide at least two arguments: entry and output.
A configuration file could be named 'webpack.config.js' in the current directory.
Use --help to display the CLI options.
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! [email protected] start: `webpack-dev-server --open`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-12-04T14_16_35_084Z-debug.log
This problem occurs because my configs are not named "webpack.config.js". Is there any way, how to run webpack-dev-server with another config or with both configs at once?
You can use the config option to specify your custom config file.