-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwebpack.config.js
45 lines (41 loc) · 1.2 KB
/
webpack.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
42
43
44
45
"use strict";
const path = require('path');
const webpack = require('webpack');
const plugins = [
new webpack.optimize.CommonsChunkPlugin({
name: "lib",
filename: "./dist/scripts/lib.js"
})
];
if (process.env.NODE_ENV === "prod") {
plugins.push(
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
mangle: false
})
)
}
module.exports = {
entry: {
app: "./client/app/app.tsx",
lib: ["react", "react-dom", "redux", "redux-thunk", "react-redux", "react-router", "axios", "iscroll/build/iscroll-probe", "qs", "react-iscroll"]
},
output: {
filename: "./dist/scripts/bundle.js",
},
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
module: {
loaders: [
{ test: /\.tsx?$/, loader: "babel?presets[]=es2015!ts" },
{ test: /\.scss$/, loader: "style!css!sass" },
{ test: /\.css$/, loader: "style!css" },
{ test: /.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/, loader: 'url-loader?limit=8192&name=[path][name].[ext]' }
]
},
plugins: plugins,
alias: {
'react': path.join(__dirname,"node_modules/react/dist/react.min")
}
};