diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-10-10 14:13:15 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-10-10 14:13:15 +0200 |
| commit | 4378f977c385f475826b9680ae4c705e5ebff910 (patch) | |
| tree | 175f671a01bb794f49ba6d8b2e1af4c8e26a732a /webpack.config.prod.js | |
| parent | a64c4fa7e1913fe14124190086d0d5624445c808 (diff) | |
deploy
Diffstat (limited to 'webpack.config.prod.js')
| -rw-r--r-- | webpack.config.prod.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/webpack.config.prod.js b/webpack.config.prod.js new file mode 100644 index 0000000..e946072 --- /dev/null +++ b/webpack.config.prod.js @@ -0,0 +1,46 @@ +const webpack = require('webpack'); +const path = require('path'); +const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); +// const CleanWebpackPlugin = require('clean-webpack-plugin'); + +module.exports = { + entry: { + main: './client/index.js', + }, + output: { + path: path.resolve(__dirname, 'dist'), + filename: 'index.js', + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': '"production"' + }), + // new UglifyJsPlugin(), + new webpack.optimize.AggressiveMergingPlugin() + ], + devtool: 'inline-source-map', + module: { + rules: [ + { + test: /\.css$/, + use: ['style-loader', 'css-loader'] + }, + { + test: /\.js$/, + include: path.resolve(__dirname, 'client'), + exclude: /(node_modules|bower_components|build)/, + loader: 'babel-loader', + options: { + presets: ['env'], + plugins: [ + require('babel-plugin-transform-runtime'), + require('babel-plugin-transform-es2015-arrow-functions'), + require('babel-plugin-transform-object-rest-spread'), + require('babel-plugin-transform-class-properties'), + require('babel-plugin-transform-react-jsx'), + ] + } + } + ] + }, +}; |
