-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.conf.js
38 lines (33 loc) · 1 KB
/
webpack.prod.conf.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
var webpack = require('webpack');
var config = require('./webpack.config.js');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var productionPlugin = new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
});
var cssExtractPlugin = new ExtractTextPlugin('styles.css');
config.devtool = '';
config.output.pathinfo = false;
config.entry = ['./app/App.js'];
config.plugins.unshift(productionPlugin);
config.plugins.push(cssExtractPlugin);
config.module.loaders = [
{
test: /\.js$/,
exclude: /(node_modules)/,
loaders: ['babel']
},
{
test: /\.styl$/,
exclude: /(node_modules)/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!stylus-loader')
},
{
test: /\.(png|jpg)$/,
exclude: /(node_modules)/,
loader: 'url-loader?name=images/[name].[ext]&limit=8192'
}
]
module.exports = config;