summaryrefslogtreecommitdiff
path: root/webpack.splash.prod.js
diff options
context:
space:
mode:
Diffstat (limited to 'webpack.splash.prod.js')
-rw-r--r--webpack.splash.prod.js50
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'),
+ ]
+ }
+ }
+ ]
+ },
+};