forked from react-love/react-latest-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pro.config.js
82 lines (78 loc) · 2.21 KB
/
pro.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* Created by admin on 2016/10/27.
*/
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
var precss = require('precss');
module.exports = {
// devtool: 'source-map',
entry: [
'babel-polyfill',
'./src/index'
],
output: {
filename: 'mobile.bundle.js',
path: path.join(__dirname, 'build'),
publicPath: '/build/',
chunkFilename: '[id].[hash].bundle.js'
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
],
resolve: {
extensions: ['', '.jsx', '.js', '.json'],
modulesDirectories: ['node_modules', 'src'],
alias: {
actions: __dirname + `/src/actions`,
components: __dirname + `/src/components`,
containers: __dirname + `/src/containers`,
reducers: __dirname + `/src/reducers`,
store: __dirname + `/src/store`,
utils: __dirname + `/src/utils`
}
},
module: {
loaders: [{
test: /\.js$/,
loaders: ['babel-loader'],
exclude: /node_modules/
}, {
test: /\.less$/,
loader: "style-loader!css-loader!less!postcss-loader"
}, {
test: /\.css/,
loader: "style-loader!css-loader!postcss-loader"
}, {
test: /\.png$/,
loader: 'file?name=[md5:hash:base64:10].[ext]'
}, {
test: /\.jpg$/,
loader: 'file?name=[md5:hash:base64:10].[ext]'
}, {
test: /\.gif$/,
loader: 'file?name=[name].[ext]'
}, {
test: /\.json$/,
loader: 'json'
}, {
test: /\.md$/,
loader: 'file?name=[name].[ext]'
}, {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=image/svg+xml'
}],
},
postcss: function () {
return [require('autoprefixer'), require('precss')];
}
};