-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
60 lines (59 loc) · 1.07 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
58
59
60
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
main: './js/app.js',
vendor: ['react','react-dom', 'lodash']
},
output: {
path: path.join(__dirname, 'static'),
filename: '[name].js',
publicPath: '/static/'
},
module: {
rules: [
{
test: require.resolve('react'),
use: 'expose-loader?React'
},
{
test: /\.js$/,
use: [{
loader: 'babel-loader',
query: {
presets: ['es2015', 'react']
}
}]
},
{
test: /\.gif$/,
use: [{
loader: 'url-loader?mimetype=image/png'
}]
},
{
test: /\.woff(2)?(\?v=[0-9].[0-9].[0-9])?$/,
use: [{
loader: 'url-loader?mimetype=application/font=woff'
}]
},
{
test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
use: [{
loader: 'file-loader?name=[name].[ext]'
}]
},
{
test: /\.css$/,
use: [{
loader: "style-loader" // creates style nodes from JS strings
}, {
loader: "css-loader" // translates CSS into CommonJS
}]
}]
},
stats: {
colors: true
},
devtool: 'source-map'
};