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');
29 'webpack/hot/dev-server',
30 'webpack-dev-server/client?http://localhost:8080',
36 filename
: 'bundle.js',
37 publicPath
: 'http://localhost:8000/build/'
40 extensions
: ['', '.js', '.jsx', '.css', '.scss'],
41 root
: path
.resolve(frameworkPath
),
43 'widgets': path
.resolve(frameworkPath
) + '/widgets',
44 'style': path
.resolve(frameworkPath
) + '/style'
49 test
: /\.(jpe?g|png|gif|svg|ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/i,
54 exclude
: [nodeModulesPath
],
55 loader
: 'babel-loader',
57 presets
: ["es2015", "stage-0", "react"]
62 loader
: 'style!css?sourceMap'
65 loader
: 'style!css?sourceMap!sass'
70 new HtmlWebpackPlugin({
71 filename
: '../index.html'
72 // ,emplateContent: '<div id="content"></div>'
74 new Webpack
.HotModuleReplacementPlugin(),
75 new Webpack
.optimize
.CommonsChunkPlugin("vendor", "vendor.js", Infinity
)
78 module
.exports
= config
;