-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
57 lines (52 loc) · 1.74 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
51
52
53
54
55
56
57
var webpack = require('webpack');
module.exports = {
entry: {
app: [
'webpack/hot/dev-server',
'webpack-dev-server/client?http://localhost:8080',
'./app/js/app.js'
],
about: [
'webpack/hot/dev-server',
'webpack-dev-server/client?http://localhost:8080',
'./app/js/about.js'
],
prefs: [
'webpack/hot/dev-server',
'webpack-dev-server/client?http://localhost:8080',
'./app/js/prefs.js'
]
},
output: {
path: './app/built',
filename: '[name].bundle.js',
publicPath: 'http://localhost:8080/built/'
},
devServer: {
contentBase: './app',
publicPath: 'http://localhost:8080/built/'
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['react', 'es2015', 'stage-0']
}
},
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader'},
{ test: /\.svg$/, loader: 'url?limit=65000&mimetype=image/svg+xml&name=public/fonts/[name].[ext]' },
{ test: /\.woff$/, loader: 'url?limit=65000&mimetype=application/font-woff&name=public/fonts/[name].[ext]' },
{ test: /\.woff2$/, loader: 'url?limit=65000&mimetype=application/font-woff2&name=public/fonts/[name].[ext]' },
{ test: /\.[ot]tf$/, loader: 'url?limit=65000&mimetype=application/octet-stream&name=public/fonts/[name].[ext]' },
{ test: /\.eot$/, loader: 'url?limit=65000&mimetype=application/vnd.ms-fontobject&name=public/fonts/[name].[ext]' }
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.IgnorePlugin(new RegExp("^(electron|fs|ipcMain|ipcRender|path|nconf)$"))
]
}