4 * Copyright 2016 RIFT.IO Inc
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
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');
30 'webpack/hot/dev-server',
31 'webpack-dev-server/client?http://localhost:8080',
37 filename
: 'bundle.js',
38 publicPath
: 'http://localhost:8000/build/'
41 extensions
: ['', '.js', '.jsx', '.css', '.scss'],
42 root
: path
.resolve(frameworkPath
),
44 'widgets': path
.resolve(frameworkPath
) + '/widgets',
45 'style': path
.resolve(frameworkPath
) + '/style'
50 test
: /\.(jpe?g|png|gif|svg|ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/i,
55 exclude
: [nodeModulesPath
],
56 loader
: 'babel-loader',
58 presets
: ["es2015", "stage-0", "react"]
63 loader
: 'style!css?sourceMap'
66 loader
: 'style!css?sourceMap!sass'
71 new HtmlWebpackPlugin({
72 filename
: '../index.html',
73 templateContent
: '<div id="content"></div>'
75 new Webpack
.HotModuleReplacementPlugin(),
76 new Webpack
.optimize
.CommonsChunkPlugin("vendor", "vendor.js", Infinity
)
79 module
.exports
= config
;