-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.conf.js
54 lines (49 loc) · 1.68 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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('webpackstyles.css');
config.devtool = '';
config.output.pathinfo = false;
config.entry = ['./app/App.jsx'];
config.plugins.unshift(productionPlugin);
// config.plugins.push(cssExtractPlugin);
config.module.loaders = [{
test: /\.js$/,
exclude: /(node_modules)/,
loaders: ['babel']
}, {
test: /\.jsx$/,
exclude: /^node_modules$/,
loaders: ['jsx', 'babel?presets[]=es2015,presets[]=react']
}, {
test: /\.css$/,
exclude: /^node_modules$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!autoprefixer-loader')
}, {
test: /\.less/,
exclude: /^node_modules$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!autoprefixer-loader!less-loader')
}, {
test: /\.(eot|woff|svg|ttf|woff2|gif|appcache)(\?|$)/,
exclude: /^node_modules$/,
loader: 'file-loader?name=[name].[ext]'
}, {
test: /\.styl$/,
exclude: /(node_modules)/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!stylus-loader')
}, {
test: /.scss$/,
exclude: /node_modules/,
loaders: ["style", "css", "sass?config=otherSassLoaderConfig"]
}, {
test: /\.(png|jpg|gif|svg)$/,
exclude: /(node_modules)/,
loader: 'url-loader?name=images/[name].[ext]&limit=8192'
}]
module.exports = config;