-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dist.js
49 lines (46 loc) · 1.46 KB
/
webpack.config.dist.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
var path = require('path');
var webpack = require('webpack');
var SRC_DIR = path.resolve(__dirname, 'src');
var CONFIG = {
entry: {
app: SRC_DIR + '/index.js'
},
output: {
path: path.resolve(__dirname, 'dist/assets'),
filename: '[name].js',
publicPath: '/assets/'
},
resolve: {
root:[
SRC_DIR,
path.resolve(__dirname, 'node_modules')
],
extensions: ['', '.js','.jsx']
},
module: {
loaders: [
{ test: /\.(js|jsx)$/, exclude: /node_modules/, include: SRC_DIR, loader: 'babel-loader' },
// { test: /\.(css|scss)$/, loaders: ['style', 'css?modules&importLoaders=1&localIdentName=[local]_[hash:base64:5]', 'sass'] },
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /\.jpg(\?v=\d+\.\d+\.\d+)?$/, loader: 'file' },
{ test: /\.png(\?v=\d+\.\d+\.\d+)?$/, loader: 'file' },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=image/svg+xml' }
]
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
],
devtool: 'source-map'
}
module.exports = CONFIG;