Added projects to user management
[osm/UI.git] / skyquake / plugins / goodbyeworld / webpack.config.js
1
2 /*
3 *
4 * Copyright 2016 RIFT.IO Inc
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19 var Webpack = require('webpack');
20 var path = require('path');
21 var nodeModulesPath = path.resolve(__dirname, 'node_modules');
22 var buildPath = path.resolve(__dirname, 'public', 'build');
23 var mainPath = path.resolve(__dirname, 'src', 'main.js');
24 var frameworkPath = '../../../framework';
25 var HtmlWebpackPlugin = require('html-webpack-plugin');
26
27 var config = {
28 devtool: 'eval',
29 entry: [
30 'webpack/hot/dev-server',
31 'webpack-dev-server/client?http://localhost:8080',
32 mainPath
33 ]
34 ,
35 output: {
36 path: buildPath,
37 filename: 'bundle.js',
38 publicPath: 'http://localhost:8000/build/'
39 },
40 resolve: {
41 extensions: ['', '.js', '.jsx', '.css', '.scss'],
42 root: path.resolve(frameworkPath),
43 alias: {
44 'widgets': path.resolve(frameworkPath) + '/widgets',
45 'style': path.resolve(frameworkPath) + '/style'
46 }
47 },
48 module: {
49 loaders: [{
50 test: /\.(jpe?g|png|gif|svg|ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/i,
51 loader: "file-loader"
52 },
53 {
54 test: /\.(js|jsx)$/,
55 exclude: [nodeModulesPath],
56 loader: 'babel-loader',
57 query: {
58 presets: ["es2015", "stage-0", "react"]
59 },
60 },
61 {
62 test: /\.css$/,
63 loader: 'style!css?sourceMap'
64 }, {
65 test: /\.scss/,
66 loader: 'style!css?sourceMap!sass'
67 }
68 ]
69 },
70 plugins: [
71 new HtmlWebpackPlugin({
72 filename: '../index.html',
73 templateContent: '<div id="content"></div>'
74 }),
75 new Webpack.HotModuleReplacementPlugin(),
76 new Webpack.optimize.CommonsChunkPlugin("vendor", "vendor.js", Infinity)
77 ]
78 };
79 module.exports = config;