X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Fgoodbyeworld%2Fwebpack.production.config.js;fp=skyquake%2Fplugins%2Fgoodbyeworld%2Fwebpack.production.config.js;h=e013478adb0b46ab35449dc8570e0144baa5126e;hb=e29efc315df33d546237e270470916e26df391d6;hp=0000000000000000000000000000000000000000;hpb=9c5e457509ba5a1822c316635c6308874e61b4b9;p=osm%2FUI.git diff --git a/skyquake/plugins/goodbyeworld/webpack.production.config.js b/skyquake/plugins/goodbyeworld/webpack.production.config.js new file mode 100644 index 000000000..e013478ad --- /dev/null +++ b/skyquake/plugins/goodbyeworld/webpack.production.config.js @@ -0,0 +1,73 @@ +/* + * + * Copyright 2016 RIFT.IO Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +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'); +// 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' + } + }, + 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: /node_modules/, + loader: 'babel-loader', + query: { + presets: ["es2015", "stage-0", "react"] + } + }, { + test: /\.css$/, + loader: 'style!css' + }, { + test: /\.scss/, + loader: 'style!css!sass' + } + ] + }, + plugins: [ + new HtmlWebpackPlugin({ + filename: '../index.html', + templateContent: '
' + }), + new Webpack.optimize.CommonsChunkPlugin("vendor", "vendor.js", Infinity) + ] +}; +module.exports = config;