-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.dist.js
63 lines (62 loc) · 1.44 KB
/
webpack.config.dist.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
/*
* Copyright (c) 2017, Itai Reuveni <[email protected]>
*
* License: MIT
*/
const webpack = require('webpack');
module.exports = {
entry: [
"."
],
output: {
path: "./dist",
publicPath: "/dist/",
filename: "megadraft-image-plugin.js",
library: "megadraft-image-plugin",
libraryTarget: "umd"
},
externals: {
"megadraft": "Megadraft",
"react": "React",
"react-dom": "ReactDOM"
},
devServer: {
inline: true,
contentBase: "./"
},
module: {
plugins: [
// Minify the code.
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
// Disabled because of an issue with Uglify breaking seemingly valid code:
// https://github.com/facebookincubator/create-react-app/issues/2376
// Pending further investigation:
// https://github.com/mishoo/UglifyJS2/issues/2011
comparisons: false,
},
mangle: {
safari10: true,
},
output: {
comments: false,
// Turned on because emoji and regex is not minified properly using default
// https://github.com/facebookincubator/create-react-app/issues/2488
ascii_only: true,
},
sourceMap: false,
}),
],
loaders: [
{
exclude: /node_modules/,
loader: "babel"
},
{
test: /\.json$/,
loader: "json"
}
]
}
};