This repository has been archived by the owner on Jun 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.babel.js
80 lines (78 loc) · 2 KB
/
webpack.config.babel.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
import webpack from 'webpack'
import HTMLWebpackPlugin from 'html-webpack-plugin'
import values from 'postcss-modules-values'
import autoprefixer from 'autoprefixer'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
const config = {
devtool: 'eval-source-map',
entry: {
app: ['./src/index.jsx'],
vendor: [
'immutable',
'isomorphic-fetch',
'marked',
'react',
'react-css-modules',
'react-dom',
'react-immutable-proptypes',
'react-redux',
'redux',
'redux-actions',
'redux-immutable',
'redux-promise',
],
},
output: {
path: `${__dirname}/public`,
filename: '[name].bundle.js',
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
devServer: {
contentBase: './public',
colors: true,
historyApiFallback: true,
},
module: {
loaders: [{
include: `${__dirname}/src`,
test: /\.jsx?$/,
loader: 'babel',
}, {
include: `${__dirname}/src`,
test: /\.css$/,
loader: ExtractTextPlugin.extract(
'css?modules&localIdentName=[local]-[hash:base64:5]!postcss'
),
}, {
include: [
`${__dirname}/node_modules/normalize.css`,
`${__dirname}/node_modules/github-markdown-css`,
`${__dirname}/node_modules/balloon-css`,
],
test: /\.css$/,
loader: ExtractTextPlugin.extract('css'),
}, {
include: `${__dirname}/src/icons/svgs`,
test: /\.svg$/,
loader: 'babel!svg-react',
}, {
include: `${__dirname}/src/imgs}`,
test: /\.(png|jpg|eot|ttf|woff|woff2|svg|otf)\??.*$/,
loader: 'url-loader?limit=8192',
}],
},
plugins: [
new HTMLWebpackPlugin({
template: `${__dirname}/src/index.html`,
favicon: './src/icons/favicon/favicon.ico',
}),
new ExtractTextPlugin('[name]-[hash].css'),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
}),
],
postcss: [values, autoprefixer],
}
export default config