webpack.config.js
import Config, { enviroment } from 'webpack-config';
enviroment.setAll({
env: () => process.env.NODE_ENV
});
export default new Config().extend('config/webpack.[env].config.js');
package.json
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-register": "^6.26.0",
"html-webpack-plugin": "^2.30.1",
"webpack": "^3.6.0",
"webpack-config": "^7.4.0"
},
"scripts": {
"build-dev": "set NODE_ENV=development && webpack --progress",
"build-prod": "set NODE_ENV=production && webpack --progress"
}
структура файлов:
webpack.config.js <-- (config/webpack.production.config.js || config/webpack.development.config.js) <-- config/webpack.base.config.js
все они на ES6
Запускаю так:
npm run build-prodP.S. webpack.config.babel.js не помог