-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.base.js
79 lines (76 loc) · 2.23 KB
/
webpack.config.base.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
const path = require('path');
const autoprefixer = require('autoprefixer');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const clientPath = path.join(__dirname, 'client');
module.exports = {
context: clientPath,
entry: {
vendor: [
'classnames',
'react',
'react-dom',
'react-addons-css-transition-group',
'react-redux',
'react-intl',
'react-intl-redux',
'redux',
'redux-optimist',
'redux-thunk',
'immutable/dist/immutable.js',
'keymirror',
'whatwg-fetch'
],
index: './index.js'
},
resolve: {
extensions: [ '', '.js', '.json', '.styl' ],
alias: {
actions: path.join(clientPath, 'actions'),
components: path.join(clientPath, 'components'),
constants: path.join(clientPath, 'constants'),
containers: path.join(clientPath, 'containers'),
middleware: path.join(clientPath, 'middleware'),
records: path.join(clientPath, 'records'),
reducers: path.join(clientPath, 'reducers'),
loc: path.join(clientPath, 'loc'),
utils: path.join(clientPath, 'utils')
}
},
resolveLoader: {
modulesDirectories: [ 'node_modules' ],
moduleTemplates: [ '*-loader', '*' ],
extensions: [ '', '.js' ]
},
module: {
noParse: [
/node_modules[\/\\]immutable[\/\\]dist[\/\\]immutable.js/
],
loaders: [
]
},
plugins: [
new HtmlWebpackPlugin({
favicon: './favicon.ico',
inject: 'body',
template: path.join(clientPath, 'index.html'),
minify: {
removeComments: true,
collapseWhitespace: true,
preserveLineBreaks: true
}
}),
new webpack.NoErrorsPlugin(),
new webpack.ProvidePlugin({
React: 'react',
ReactDOM: 'react-dom'
})
],
postcss: function() {
return [
autoprefixer({
browsers: [ 'last 2 versions' ]
})
];
}
};