first commit

This commit is contained in:
Senad Uka
2018-05-07 16:07:00 +02:00
commit 8b4f09f9d5
3368 changed files with 852614 additions and 0 deletions

33
webpack.config.js Normal file
View File

@@ -0,0 +1,33 @@
'use strict';
/* eslint no-console: "off" */
const webpackConfigs = require('./config/webpack');
const defaultConfig = 'dev';
module.exports = (configName) => {
// If there was no configuration give, assume default
const requestedConfig = configName || defaultConfig;
// Return a new instance of the webpack config
// or the default one if it cannot be found.
let LoadedConfig = defaultConfig;
if (webpackConfigs[requestedConfig] !== undefined) {
LoadedConfig = webpackConfigs[requestedConfig];
} else {
console.warn(`
Provided environment "${configName}" was not found.
Please use one of the following ones:
${Object.keys(webpackConfigs).join(' ')}
`);
LoadedConfig = webpackConfigs[defaultConfig];
}
const loadedInstance = new LoadedConfig();
// Set the global environment
process.env.NODE_ENV = loadedInstance.env;
return loadedInstance.config;
};