-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.config.js
43 lines (33 loc) · 1.06 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
module.exports = {
// set the context (optional)
context: __dirname + '/src',
entry: 'index.js',
// enable loading modules relatively (without the ../../ prefix)
resolve: {
root: [__dirname + "/src"]
},
module: {
loaders: [
// load and compile javascript
{ test: /\.js$/, exclude: /node_modules/, loader:"babel" },
// load css and process less
{ test: /\.css$/, loader: "style!css"},
// load JSON files and HTML
{ test: /\.json$/, loader: "json" },
{ test: /\.html$/, exclude: /node_modules/, loader:"raw" },
// 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'}
]
},
// webpack dev server configuration
devServer: {
contentBase: "./src",
noInfo: false,
hot: true
},
// support source maps
devtool: "#inline-source-map"
};