-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.production.js
54 lines (51 loc) · 1.43 KB
/
webpack.config.production.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
const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
entry: {
app: './src/app'
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
include: path.resolve(__dirname, 'src')
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style', '!css!postcss')
},
{
test: /\.styl$/,
loader: ExtractTextPlugin.extract('style', '!css!postcss!stylus')
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style', '!css!postcss!sass')
},
{
test: /\.(eot|svg|ttf|woff)$/,
loader: 'file?name=fonts/[hash].[ext]'
}
]
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'static')
},
resolve: {
extensions: ['', '.js', '.jsx']
},
postcss: [
require('autoprefixer')()
],
plugins: [
new ExtractTextPlugin('[name].bundle.css'),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
})
]
}