-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.client.js
51 lines (50 loc) · 1.32 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
var webpack = require("webpack");
var path = require("path");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var cwd = process.cwd();
module.exports = {
target: "web",
cache: false,
context: __dirname,
devtool: false,
entry: ["./src/client", "./style/main.scss"],
output: {
path: path.join(cwd, "static/dist"),
filename: "client.js",
chunkFilename: "[name][id].js",
publicPath: "dist/"
},
plugins: [
new webpack.DefinePlugin({isBrowser: true}),
new webpack.DefinePlugin({"process.env": {NODE_ENV: '"production"'}}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin(),
new ExtractTextPlugin("style.css")
],
module: {
preLoaders: [],
loaders: [
{test: /\.json$/, loaders: ["json"]},
{test: /\.jsx?$/, loaders: ["babel"], exclude: /node_modules/},
{test: /\.scss$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!sass-loader')}
],
postLoaders: [],
noParse: /\.min\.js/
},
resolve: {
alias: {
react: path.join(__dirname, "node_modules/react")
},
modulesDirectories: [
"src",
"node_modules",
"web_modules"
],
extensions: ["", ".json", ".js", ".jsx"]
},
node: {
__dirname: true,
fs: 'empty'
}
};