From 340236cbe4a5bfb3fb3583f177ba7a493bb4f21c Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 26 May 2020 06:14:12 +0300 Subject: Update to `@rollup/plugin-babel` (#30742) --- build/babel-helpers.js | 14 -------------- build/build-plugins.js | 7 +++---- build/rollup.config.js | 7 +++---- 3 files changed, 6 insertions(+), 22 deletions(-) delete mode 100644 build/babel-helpers.js (limited to 'build') diff --git a/build/babel-helpers.js b/build/babel-helpers.js deleted file mode 100644 index 30a5156771..0000000000 --- a/build/babel-helpers.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' - -// These are the babel helpers we whitelist -const helpers = [ - 'createClass', - 'createSuper', - 'defineProperties', - 'defineProperty', - 'getPrototypeOf', - 'inheritsLoose', - 'objectSpread2' -] - -module.exports = helpers diff --git a/build/build-plugins.js b/build/build-plugins.js index 44d155c4f9..c57c53ce4e 100644 --- a/build/build-plugins.js +++ b/build/build-plugins.js @@ -11,16 +11,15 @@ const path = require('path') const rollup = require('rollup') -const babel = require('rollup-plugin-babel') +const { babel } = require('@rollup/plugin-babel') const banner = require('./banner.js') -const babelHelpers = require('./babel-helpers.js') const plugins = [ babel({ // Only transpile our source code exclude: 'node_modules/**', - // Include only required helpers - externalHelpersWhitelist: babelHelpers + // Inline the required helpers in each file + babelHelpers: 'inline' }) ] const bsPlugins = { diff --git a/build/rollup.config.js b/build/rollup.config.js index d32346e101..a792502172 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -1,10 +1,9 @@ 'use strict' const path = require('path') -const babel = require('rollup-plugin-babel') +const { babel } = require('@rollup/plugin-babel') const resolve = require('@rollup/plugin-node-resolve') const banner = require('./banner.js') -const babelHelpers = require('./babel-helpers.js') const BUNDLE = process.env.BUNDLE === 'true' const ESM = process.env.ESM === 'true' @@ -15,8 +14,8 @@ const plugins = [ babel({ // Only transpile our source code exclude: 'node_modules/**', - // Include only required helpers - externalHelpersWhitelist: babelHelpers + // Include the helpers in the bundle, at most one copy of each + babelHelpers: 'bundled' }) ] const globals = { -- cgit v1.2.3