-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
38 lines (31 loc) · 935 Bytes
/
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
var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'eval',
entry: [
'webpack-hot-middleware/client',
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
module: {
loaders: [
// load and compile javascript
{ test: [/\.js$/, /\.jsx$/], exclude: /node_modules/, loader:"babel" },
// load css and process less
{ test: /\.css$/, loader: "style!css"},
// load fonts(inline base64 URLs for <=8k)
{ test: /\.(ttf|eot|svg|otf)$/, loader: "file" },
{ test: /\.woff(2)?$/, loader: "url?limit=8192&minetype=application/font-woff"},
// load images (inline base64 URLs for <=8k images)
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'}
]
}
};