-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.babel.js
74 lines (65 loc) · 1.86 KB
/
webpack.config.babel.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import path from "path";
import fs from "fs";
import webpack from "webpack";
export default {
entry: (function () {
var entry = {};
fs.readdirSync("es2015/")
.filter(_path => {
return fs.statSync(`es2015/${_path}`).isFile() && [".ts", ".js"].indexOf(path.extname(`es2015/${_path}`)) !== -1;
})
.map(_path =>{
entry[path.parse(_path).name] = `./es2015/${_path}`;
return `./es2015/${_path}`;
});
//entry["lib"] = ["babel-polyfill"];
return entry;
})(),
output: {
path: path.join(__dirname, '/js'),
filename: '[name].js'
},
plugin: [
//new webpack.optimize.CommonsChunkPlugin("lib", "lib.js"),
// new webpack.optimize.UglifyJsPlugin({
// compress: {
// warnings: false
// }
// }),
//new webpack.optimize.DedupePlugin()
],
resolve: {
extensions: ['', '.js', '.jsx', '.ts', '.tsx']
},
module: {
loaders: [
{
test: /\.js|jsx$/,
loaders: ['babel-loader'],
exclude: /node_modules/
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.ts|tsx?$/,
loaders: ['ts-loader']
},
{
test: /\.scss|css$/,
loaders: ["style-loader", "css-loader", "sass-loader"]
},
,
{
test: /\.html$/,
loaders: ['html-loader']
},
{
test: /\.(png|jpg|jpeg|svg)$/,
loader: "url-loader?limit=50000"
}
]
},
devtool: 'source-map'
};