2 * STANDARD_RIFT_IO_COPYRIGHT
4 var webpack
= require('webpack');
5 var path
= require('path');
6 var nodeModulesPath
= path
.resolve(__dirname
, 'node_modules');
7 var buildPath
= path
.resolve(__dirname
, 'public', 'build');
8 var mainPath
= path
.resolve(__dirname
, 'src', 'main.js');
9 var uiPluginCmakeBuild
= process
.env
.ui_plugin_cmake_build
|| false;
10 var frameworkPath
= uiPluginCmakeBuild
?'../../../../skyquake/skyquake-build/framework':'../../framework';
11 var HtmlWebpackPlugin
= require('html-webpack-plugin');
12 var CompressionPlugin
= require("compression-webpack-plugin");
13 // Added to overcome node-sass bug https://github.com/iam4x/isomorphic-flux-boilerplate/issues/62
14 process
.env
.UV_THREADPOOL_SIZE
=64;
16 devtool
: 'source-map',
20 filename
: 'bundle.js',
24 extensions
: ['', '.js', '.jsx', '.css', '.scss'],
25 root
: path
.resolve(frameworkPath
),
27 'widgets': path
.resolve(frameworkPath
) + '/widgets',
28 'style': path
.resolve(frameworkPath
) + '/style',
29 'utils': path
.resolve(frameworkPath
) + '/utils'
34 test
: /\.(jpe?g|png|gif|svg|ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/i,
39 exclude
: /react-treeview/,
40 loader
: 'babel-loader',
42 presets
: ["es2015", "stage-0", "react"]
49 loader
: 'style!css!sass?includePaths[]='+ path
.resolve(frameworkPath
)
54 new HtmlWebpackPlugin({
55 filename
: '../index.html',
56 templateContent
: '<div id="app"></div>'
61 if (process
.argv
.indexOf('--optimize-minimize') !== -1) {
62 // we are going to output a gzip file in the production process
63 config
.output
.filename
= "gzip-" + config
.output
.filename
;
64 config
.plugins
.push(new webpack
.DefinePlugin({ // <-- key to reducing React's size
66 'NODE_ENV': JSON
.stringify('production')
69 config
.plugins
.push(new CompressionPlugin({
70 asset
: "[path]", // overwrite js file with gz file
75 module
.exports
= config
;