-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.prod.config.js
41 lines (37 loc) · 1.12 KB
/
webpack.prod.config.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
var base = require("./webpack.base.config");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var webpack = require("webpack");
module.exports = base({
devtool: "sourcemap",
output: {
publicPath: "/"
},
// Necessary plugins for hot load
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": "'production'",
"process.env.ROOT_ROUTE": "'/'",
"process.env.SUBSITE": '"' + process.env.SUBSITE + '"'
}),
new ExtractTextPlugin("styles.css"),
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.DedupePlugin()
],
// Transform source code using Babel and React Hot Loader
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loaders: ["babel-loader"]
},
{
test: /\.(scss|css)$/,
loader: ExtractTextPlugin.extract(
'css-loader?camelCase&modules&importLoaders=3&localIdentName=[name]__[local]__[hash]!autoprefixer?{browsers:["last 2 version", "ie>=10"]}!resolve-url-loader!sass-loader?sourceMap'
)
}
]
}
});