Skip to content

Commit db9609a

Browse files
committed
perf(Code refactoring and removal of useless code to optimize the plugin):
1 parent ee4e0db commit db9609a

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

Gruntfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ module.exports = function(grunt) {
6060
plugins: webpackConfig.plugins.concat(
6161
new webpack.optimize.UglifyJsPlugin({
6262
compress: {
63-
drop_console: true
63+
drop_console: true,
64+
warnings:false
6465
},
6566
sourceMap: true
6667
}),

webpack.config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
entry: './src/embed.es6',
77
output: {
88
path: path.join(__dirname, 'dist'),
9-
filename: 'embed.js',
9+
filename: 'embed.min.js',
1010
publicPath: 'dist/'
1111
},
1212
module: {
@@ -25,8 +25,11 @@ module.exports = {
2525
// Avoid publishing files when compilation failed
2626
new webpack.NoErrorsPlugin(),
2727
new webpack.ProvidePlugin({
28-
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
29-
})
28+
'regeneratorRuntime':'imports?this=>global!exports?global.regeneratorRuntime!regenerator/runtime.js',
29+
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch',
30+
'fetchJsonp': 'fetch-jsonp'
31+
}),
32+
new webpack.optimize.DedupePlugin()
3033
],
3134
stats: {
3235
// Nice colored output

0 commit comments

Comments
 (0)