-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.client.js
More file actions
36 lines (35 loc) · 927 Bytes
/
webpack.client.js
File metadata and controls
36 lines (35 loc) · 927 Bytes
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
const webpack = require("webpack");
const path = require("path");
module.exports = {
target: "web",
cache: false,
context: __dirname,
devtool: false,
entry: ["./src/client"],
output: {
path: path.join(__dirname, "static/dist"),
filename: "client.js",
chunkFilename: "[name].[id].js",
publicPath: "dist/"
},
plugins: [
new webpack.DefinePlugin({__CLIENT__: true, __SERVER__: false}),
new webpack.DefinePlugin({"process.env": {NODE_ENV: '"production"'}}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin()
],
module: {
loaders: [
{include: /\.css$/, loaders: ["style", "css"]},
{include: /\.json$/, loaders: ["json"]},
{include: /\.jsx?$/,
loaders: ["react-hot", "babel-loader", "jsx?harmony"],
exclude: /node_modules/
}
]
},
resolve: {
extensions: ["", ".jsx", ".js"]
}
};