diff options
| author | adamhrv <adam@ahprojects.com> | 2019-01-28 18:11:52 +0100 |
|---|---|---|
| committer | adamhrv <adam@ahprojects.com> | 2019-01-28 18:11:52 +0100 |
| commit | f8b279b2f0be793c5f877cac6373332954c6a5de (patch) | |
| tree | 60be7caeb0e8c96c59718300c68d5b1cdecde6f4 /webpack.splash.prod.js | |
| parent | dd2c36288aa1e8af14588f9258f6785879b8638c (diff) | |
| parent | b0eb2d9672044a1b64a2a1f21540f9ef1bd7b571 (diff) | |
Merge branch 'master' of github.com:adamhrv/megapixels_dev
Diffstat (limited to 'webpack.splash.prod.js')
| -rw-r--r-- | webpack.splash.prod.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/webpack.splash.prod.js b/webpack.splash.prod.js new file mode 100644 index 00000000..78359a8c --- /dev/null +++ b/webpack.splash.prod.js @@ -0,0 +1,50 @@ +require('dotenv').config() + +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/splash/index.js', + }, + output: { + path: path.resolve(__dirname, 'site/assets/js/dist'), + filename: 'splash.js', + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': '"production"', + 'process.env.S3_HOST': '"' + process.env.S3_HOST + '"', + 'process.env.API_HOST': '""', + }), + 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'), + ] + } + } + ] + }, +}; |
