Skip to content

Commit 856a244

Browse files
committed
fix webpack build
1 parent 14e5dcf commit 856a244

1 file changed

Lines changed: 72 additions & 43 deletions

File tree

‎webpack.config.js‎

Lines changed: 72 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,78 @@
11
var webpack = require('webpack')
2-
var config = {
3-
entry: './src/entry.js',
4-
output: {
5-
path:'./dist',
6-
filename: 'cloudboost.js',
7-
library: "cloudboost",
8-
libraryTarget: 'umd',
9-
umdNamedDefine: true,
2+
var config = [{
3+
entry: './src/entry.js',
4+
output: {
5+
path: './dist',
6+
filename: 'cloudboost.js',
7+
library: "cloudboost",
8+
libraryTarget: 'umd',
9+
umdNamedDefine: true,
1010

11-
},
12-
externals:{
13-
IO:"socket.io-client",
14-
Axios:"axios"
15-
},
16-
module: {
17-
loaders: [
18-
{ test: /\.json$/, loader: 'json' },
19-
{
20-
test: /\.js?$/,
21-
exclude: /node_modules/,
22-
loader: 'babel',
23-
query: {
24-
presets: ["es2015-without-strict"],
25-
compact: false
11+
},
12+
externals: {
13+
IO: "socket.io-client",
14+
Axios: "axios"
15+
},
16+
module: {
17+
loaders: [
18+
{ test: /\.json$/, loader: 'json' },
19+
{
20+
test: /\.js?$/,
21+
exclude: /node_modules/,
22+
loader: 'babel',
23+
query: {
24+
presets: ["es2015-without-strict"],
25+
compact: false
26+
}
2627
}
27-
}
28-
]
29-
},
30-
plugins: [
31-
// new webpack.optimize.UglifyJsPlugin({
32-
// compress: {
33-
// warnings: false,
34-
// },
35-
// mangle: false,
36-
// output: {
37-
// comments: false,
38-
// },
39-
// }),
40-
// new webpack.optimize.DedupePlugin(),
41-
// new webpack.DefinePlugin({
42-
// 'process.env': {
43-
// 'NODE_ENV': JSON.stringify('production')
44-
// }
45-
// })
28+
]
29+
},
30+
plugins: []
31+
}, {
32+
entry: './src/entry.js',
33+
output: {
34+
path: './dist',
35+
filename: 'cloudboost.min.js',
36+
library: "cloudboost",
37+
libraryTarget: 'umd',
38+
umdNamedDefine: true,
39+
40+
},
41+
externals: {
42+
IO: "socket.io-client",
43+
Axios: "axios"
44+
},
45+
module: {
46+
loaders: [
47+
{ test: /\.json$/, loader: 'json' },
48+
{
49+
test: /\.js?$/,
50+
exclude: /node_modules/,
51+
loader: 'babel',
52+
query: {
53+
presets: ["es2015-without-strict"],
54+
compact: false
55+
}
56+
}
57+
]
58+
},
59+
plugins: [
60+
new webpack.optimize.UglifyJsPlugin({
61+
compress: {
62+
warnings: false,
63+
},
64+
mangle: false,
65+
output: {
66+
comments: false,
67+
},
68+
}),
69+
new webpack.optimize.DedupePlugin(),
70+
new webpack.DefinePlugin({
71+
'process.env': {
72+
'NODE_ENV': JSON.stringify('production')
73+
}
74+
})
4675
]
47-
}
76+
}]
4877

4978
module.exports = config;

0 commit comments

Comments
 (0)