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");
14 // Added to overcome node-sass bug https://github.com/iam4x/isomorphic-flux-boilerplate/issues/62
15 process
.env
.UV_THREADPOOL_SIZE
=64;
16 var htmlFilename
= (process
.argv
.indexOf('--production-debug') !== -1) ? 'debug.html' : 'index.html';
18 devtool
: 'source-map',
22 filename
: 'bundle.js',
26 extensions
: ['', '.js', '.jsx', '.css', '.scss'],
27 root
: path
.resolve(frameworkPath
),
29 'widgets': path
.resolve(frameworkPath
) + '/widgets',
30 'style': path
.resolve(frameworkPath
) + '/style',
31 'utils': path
.resolve(frameworkPath
) + '/utils'
36 test
: /\.(jpe?g|png|gif|svg|ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/i,
41 exclude
: /react-treeview/,
42 loader
: 'babel-loader',
44 presets
: ["es2015", "stage-0", "react"]
51 loader
: 'style!css!sass?includePaths[]='+ path
.resolve(frameworkPath
)
56 new HtmlWebpackPlugin({
57 filename
: '../' + htmlFilename
,
58 template
: frameworkPath
+ '/plugin-index.html'
63 if (process
.argv
.indexOf('--optimize-minimize') !== -1) {
64 // we are going to output a gzip file in the production process
65 config
.output
.filename
= "gzip-" + config
.output
.filename
;
66 config
.plugins
.push(new webpack
.DefinePlugin({ // <-- key to reducing React's size
68 'NODE_ENV': JSON
.stringify('production')
71 config
.plugins
.push(new CompressionPlugin({
72 asset
: "[path]", // overwrite js file with gz file
78 module
.exports
= config
;