From b772c6351cf3b3bd5a30ca8976e51492f72f1c64 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 20 Feb 2017 17:53:47 +0200 Subject: [PATCH] feature(client) object.assign -> babel-plugin-object-assign: decrease client size by 2kb --- .babelrc | 5 ++++- client/cloudcmd.js | 2 -- package.json | 2 +- webpack.config.js | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.babelrc b/.babelrc index f94f27f5..a8afe9e8 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,9 @@ { "presets": [ "es2015" - ] + ], + "plugins": [ + "transform-object-assign" + ] } diff --git a/client/cloudcmd.js b/client/cloudcmd.js index b48f76c2..31b7a696 100644 --- a/client/cloudcmd.js +++ b/client/cloudcmd.js @@ -8,8 +8,6 @@ window.Emitify = require('emitify'); window.CloudCmd = (config) => { window.Promise = window.Promise || require('es6-promise'); - Object.assign = Object.assign || require('object.assign'); - window.Util = require('../common/util'); window.CloudFunc = require('../common/cloudfunc'); diff --git a/package.json b/package.json index 4e10a3a8..db8895ba 100644 --- a/package.json +++ b/package.json @@ -153,6 +153,7 @@ "devDependencies": { "babel-cli": "^6.18.0", "babel-loader": "^6.2.10", + "babel-plugin-transform-object-assign": "^6.22.0", "babel-preset-es2015": "^6.18.0", "coveralls": "^2.11.6", "emitify": "^2.1.1", @@ -168,7 +169,6 @@ "nodemon": "^1.9.1", "nsp": "^2.2.1", "nyc": "^10.1.2", - "object.assign": "^4.0.4", "place": "^1.1.4", "readjson": "^1.1.3", "recess": "^1.1.9", diff --git a/webpack.config.js b/webpack.config.js index 3c8c3c0b..68b45f66 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -72,7 +72,6 @@ function externals(context, request, fn) { const list = [ 'es6-promise', - 'object.assign', ]; if (list.includes(request))