-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathwebpack.base.js
More file actions
43 lines (42 loc) · 1.22 KB
/
webpack.base.js
File metadata and controls
43 lines (42 loc) · 1.22 KB
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
var webpack = require('webpack');
var path = require('path');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var NODE_ENV = process.env.NODE_ENV
module.exports = {
plugins: [
new ProgressBarPlugin(),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify(NODE_ENV)
}
}),
],
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js',
publicPath: '/dist/',
},
resolve: {
alias: {
"react": path.resolve('./node_modules/react'),
"react-router-dom": path.resolve('./node_modules/react-router-dom')
},
},
module: {
rules: [{
test: /\.(png|jpg)$/,
use: 'url-loader?limit=8192&name=./image/[name].[ext]'
}, {
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: "babel-loader",
}, {
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
use: 'babel-loader',
}, {
test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
use: 'url-loader?limit=10000&name=./font/[name].[ext]'
}],
}
};