Require the config as CLI arg for watch, build and production-build
The mqtt control map now loads the config provided via cli. It is no longer required to modify the src/config.js to load a different config.
This commit is contained in:
parent
3975518f6e
commit
c7ca716802
8 changed files with 34 additions and 22 deletions
|
|
@ -10,9 +10,17 @@ const extractCSS = ExtractTextPlugin.extract({
|
|||
}
|
||||
});
|
||||
|
||||
module.exports = merge(common, {
|
||||
const configPath = env => {
|
||||
if (env === true) {
|
||||
throw "No config file was provided.";
|
||||
}
|
||||
return path.resolve(__dirname, `config/${env}`);
|
||||
};
|
||||
|
||||
module.exports = env => merge(common, {
|
||||
entry: {
|
||||
main: path.resolve(__dirname, 'src/index.jsx')
|
||||
main: [configPath(env),
|
||||
path.resolve(__dirname, 'src/index.jsx')]
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue