-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathwebpack.client.js
32 lines (31 loc) · 899 Bytes
/
webpack.client.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
var webpack = require("webpack");
var path = require("path");
module.exports = {
target: "web",
cache: false,
context: __dirname,
devtool: false,
entry: {example:"./src/example"},
output: {
path: path.join(__dirname, "static/dist"),
filename: "[name].js",
chunkFilename: "[name].[id].js",
publicPath: "dist/"
},
plugins: [
new webpack.DefinePlugin({"process.env": {NODE_ENV: '"production"'}}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin()
],
module: {
loaders: [
{test: /\.json$/, loaders: ["json-loader"]},
{test: /\.js$/, loaders: ["babel-loader?presets[]=es2015&presets[]=react"], exclude: /node_modules/},
{test: /\.scss$/, loaders: ["raw-loader", "sass-loader"], exclude: /node_modules/}
]
},
resolve: {
extensions: ["", ".json", ".jsx", ".js"]
}
};