This repository was archived by the owner on Jun 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathwebpack.config.babel.js
More file actions
65 lines (63 loc) · 1.53 KB
/
Copy pathwebpack.config.babel.js
File metadata and controls
65 lines (63 loc) · 1.53 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import webpack from 'webpack';
import qs from 'querystring';
import autoprefixer from 'autoprefixer';
const cssLoaderQuries = qs.stringify({
modules: true,
importLoaders: 1,
localIdentName: '[path]_[local]_[hash:base64:4]',
});
//noinspection JSUnresolvedFunction
export default {
devtool: '#inline-source-map',
entry: {
client: [
'./client/index.jsx',
'webpack-hot-middleware/client?noInfo=true&reload=true',
],
vendor: [
'react',
'react-dom',
'redux',
'react-redux',
'react-router',
'react-router-redux',
'redux-logger',
'redbox-react',
'webpack-hot-middleware/client?noInfo=true&reload=true',
],
},
output: {
path: `${__dirname}/public/assets`,
filename: '[name].js',
publicPath: '/assets',
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
module: {
loaders: [
{
test: /\.css$/,
loader: `style!css?${cssLoaderQuries}!postcss`,
include: [`${__dirname}/common`],
},
{
test: /\.jsx?$/,
loader: `babel?cacheDirectory`,
include: [`${__dirname}/client`, `${__dirname}/common`],
},
],
},
postcss() {
return [autoprefixer];
},
plugins: [
new webpack.DefinePlugin({
'NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
}),
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
],
};