const path = require('path');
const babiliPlugin = require('babili-webpack-plugin');
let plugins = [];
if (process.env.NODE_ENV =='production'){
plugins.push(new babiliPlugin())
};
module.exports={
entry:'./app-src/app.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: 'dist'
},
module:{
rules:[
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
}
]
},
plugins
}
{
"name": "client",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build-dev": "webpack --config webpack-config.js",
"build-prod": "cross-env NODE_ENV=production webpack --config webpack-config.js",
"start": "webpack-dev-server"
},
"author": "",
"license": "ISC",
"dependencies": {
"reflect-metadata": "^0.1.10"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-loader": "^7.1.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2017": "^6.24.1",
"babili-webpack-plugin": "^0.1.1",
"cross-env": "^5.0.1",
"webpack": "^3.1.0",
"webpack-dev-server": "^2.5.1"
}
}