Skip to content

Commit

Permalink
Update to @rollup/plugin-babel (#30742)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed May 26, 2020
1 parent c9cd3e4 commit 340236c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 42 deletions.
14 changes: 0 additions & 14 deletions build/babel-helpers.js

This file was deleted.

7 changes: 3 additions & 4 deletions build/build-plugins.js
Expand Up @@ -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 = {
Expand Down
7 changes: 3 additions & 4 deletions 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'
Expand All @@ -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 = {
Expand Down
5 changes: 3 additions & 2 deletions js/tests/integration/rollup.bundle.js
@@ -1,7 +1,7 @@
/* eslint-env node */

const resolve = require('@rollup/plugin-node-resolve')
const babel = require('rollup-plugin-babel')
const { babel } = require('@rollup/plugin-babel')

module.exports = {
input: 'js/tests/integration/bundle.js',
Expand All @@ -12,7 +12,8 @@ module.exports = {
plugins: [
resolve(),
babel({
exclude: 'node_modules/**'
exclude: 'node_modules/**',
babelHelpers: 'bundled'
})
]
}
10 changes: 3 additions & 7 deletions js/tests/karma.conf.js
@@ -1,15 +1,14 @@
/* eslint-env node */
const path = require('path')
const ip = require('ip')
const babel = require('rollup-plugin-babel')
const { babel } = require('@rollup/plugin-babel')
const istanbul = require('rollup-plugin-istanbul')
const resolve = require('@rollup/plugin-node-resolve')

const {
browsers,
browsersKeys
} = require('./browsers')
const babelHelpers = require('../../build/babel-helpers.js')

const { env } = process
const browserStack = env.BROWSER === 'true'
Expand Down Expand Up @@ -77,11 +76,8 @@ const conf = {
babel({
// Only transpile our source code
exclude: 'node_modules/**',
// Include only required helpers
externalHelpersWhitelist: babelHelpers,
plugins: [
'@babel/plugin-proposal-object-rest-spread'
]
// Inline the required helpers in each file
babelHelpers: 'inline'
}),
resolve()
],
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -96,6 +96,7 @@
"@babel/core": "^7.9.6",
"@babel/plugin-proposal-object-rest-spread": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"@rollup/plugin-babel": "^5.0.2",
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-node-resolve": "^7.1.3",
"autoprefixer": "^9.8.0",
Expand Down Expand Up @@ -129,7 +130,6 @@
"popper.js": "^1.16.0",
"postcss-cli": "^7.1.1",
"rollup": "^2.10.4",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-istanbul": "^2.0.1",
"serve": "^11.3.0",
"shelljs": "^0.8.4",
Expand Down

0 comments on commit 340236c

Please sign in to comment.