X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Fconfig%2Fwebpack.production.config.js;fp=skyquake%2Fplugins%2Fconfig%2Fwebpack.production.config.js;h=49ad6317ade8f55b773a4a47959de3688409ca8b;hb=dfe972ff7c9f7b6b1d730e66b0b2aa8df2ce329b;hp=0000000000000000000000000000000000000000;hpb=e8b63f1993b397787576bdd884366a6640a5adea;p=osm%2FUI.git diff --git a/skyquake/plugins/config/webpack.production.config.js b/skyquake/plugins/config/webpack.production.config.js new file mode 100644 index 000000000..49ad6317a --- /dev/null +++ b/skyquake/plugins/config/webpack.production.config.js @@ -0,0 +1,61 @@ +/* + * STANDARD_RIFT_IO_COPYRIGHT + */ +var Webpack = require('webpack'); +var path = require('path'); +var nodeModulesPath = path.resolve(__dirname, 'node_modules'); +var buildPath = path.resolve(__dirname, 'public', 'build'); +var mainPath = path.resolve(__dirname, 'src', 'main.js'); +var uiPluginCmakeBuild = process.env.ui_plugin_cmake_build || false; +var frameworkPath = uiPluginCmakeBuild?'../../../../skyquake/skyquake-build/framework':'../../framework'; +var HtmlWebpackPlugin = require('html-webpack-plugin'); +var CommonsPlugin = new require("webpack/lib/optimize/CommonsChunkPlugin") +// Added to overcome node-sass bug https://github.com/iam4x/isomorphic-flux-boilerplate/issues/62 +process.env.UV_THREADPOOL_SIZE=64; +var config = { + devtool: 'source-map', + entry: mainPath, + output: { + path: buildPath, + filename: 'bundle.js', + publicPath: "build/" + }, + resolve: { + extensions: ['', '.js', '.jsx', '.css', '.scss'], + root: path.resolve(frameworkPath), + alias: { + 'widgets': path.resolve(frameworkPath) + '/widgets', + 'style': path.resolve(frameworkPath) + '/style', + 'utils': path.resolve(frameworkPath) + '/utils' + } + }, + module: { + loaders: [{ + test: /\.(jpe?g|png|gif|svg|ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/i, + loader: "file-loader" + }, + { + test: /\.(js|jsx)$/, + exclude: /react-treeview/, + loader: 'babel-loader', + query: { + presets: ["es2015", "stage-0", "react"] + } + }, { + test: /\.css$/, + loader: 'style!css' + }, { + test: /\.scss/, + loader: 'style!css!sass?includePaths[]='+ path.resolve(frameworkPath) + } + ] + }, + plugins: [ + new HtmlWebpackPlugin({ + filename: '../index.html' + , templateContent: '
' + }), + new Webpack.optimize.CommonsChunkPlugin("vendor", "vendor.js", Infinity) + ] +}; +module.exports = config;