-
Notifications
You must be signed in to change notification settings - Fork 23
/
webpack.config.js
50 lines (49 loc) · 1.36 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var path = require('path');
var webpack = require('webpack');
module.exports = {
//devtool: 'cheap-module-eval-source-map',
entry: [
//'webpack-dev-server/client?http://0.0.0.0:3000', // WebpackDevServer host and port
//'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
'./src/index'
],
output: {
path: path.join(__dirname, 'static'),
filename: 'bundle.js',
publicPath: 'static/'
},
plugins: [
//new webpack.HotModuleReplacementPlugin(),
//new webpack.IgnorePlugin(new RegExp("^(fs|path)$"))
],
module: {
loaders: [
{
test: /\.js?$/,
loaders: ['babel'],
exclude: /node_modules/,
include: __dirname
}, {
test: /\.scss?$/,
loaders: ['style', 'css', 'sass'],
include: __dirname,
exclude: /node_modules\/[^font]/
},
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&minetype=application/font-woff" },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }
]
},
externals: [
(function () {
var IGNORES = [
'electron'
];
return function (context, request, callback) {
if (IGNORES.indexOf(request) >= 0) {
return callback(null, "require('" + request + "')");
}
return callback();
};
})()
]
};