]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Backport #30742
authorXhmikosR <xhmikosr@gmail.com>
Tue, 26 May 2020 16:20:15 +0000 (19:20 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Thu, 4 Jun 2020 14:53:16 +0000 (17:53 +0300)
Update to `@rollup/plugin-babel`

build/babel-helpers.js [deleted file]
build/build-plugins.js
build/rollup.config.js
js/tests/integration/rollup.bundle.js
package-lock.json
package.json

diff --git a/build/babel-helpers.js b/build/babel-helpers.js
deleted file mode 100644 (file)
index d444628..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict'
-
-// These are the babel helpers we whitelist
-const helpers = [
-  'createClass',
-  'createSuper',
-  'defineProperties',
-  'defineProperty',
-  'inheritsLoose',
-  'objectSpread2'
-]
-
-module.exports = helpers
index 9e4f2e1c3291a012e9e1cbc82cb4eaca8bead6fc..00ae91d5dd60473000fa335b3bbcfec961692690 100644 (file)
@@ -9,19 +9,18 @@
 
 'use strict'
 
-const path    = require('path')
-const rollup  = require('rollup')
-const babel   = require('rollup-plugin-babel')
-const banner  = require('./banner.js')
-const babelHelpers = require('./babel-helpers.js')
+const path = require('path')
+const rollup = require('rollup')
+const { babel } = require('@rollup/plugin-babel')
+const banner = require('./banner.js')
 
-const TEST    = process.env.NODE_ENV === 'test'
+const TEST = process.env.NODE_ENV === 'test'
 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 = {
index 2d43194fe9b886d0e89e9c623bf33783eeb35f1d..95e412f0e7f74861a6a7a1f63d745dcb2bf43b90 100644 (file)
@@ -1,21 +1,20 @@
 'use strict'
 
-const path    = require('path')
-const babel   = require('rollup-plugin-babel')
+const path = require('path')
+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 banner = require('./banner.js')
 
-const BUNDLE  = process.env.BUNDLE === 'true'
+const BUNDLE = process.env.BUNDLE === 'true'
 
-let fileDest  = 'bootstrap.js'
+let fileDest = 'bootstrap.js'
 const external = ['jquery', 'popper.js']
 const plugins = [
   babel({
-  // Only transpile our source code
+    // 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 = {
index f2183e757101cdc5162a68d9948ce3e3218d81d7..e554d8ce4710a45780c5125f787a111318bb04bc 100644 (file)
@@ -2,7 +2,7 @@
 
 const resolve = require('@rollup/plugin-node-resolve')
 const commonjs = require('@rollup/plugin-commonjs')
-const babel = require('rollup-plugin-babel')
+const { babel } = require('@rollup/plugin-babel')
 
 module.exports = {
   input: 'js/tests/integration/bundle.js',
@@ -14,7 +14,8 @@ module.exports = {
     resolve(),
     commonjs(),
     babel({
-      exclude: 'node_modules/**'
+      exclude: 'node_modules/**',
+      babelHelpers: 'bundled'
     })
   ]
 }
index 93bb1b851b2d65c21033951b4d5ed34b342c07b2..2ebf239b29ff340a1238c601717374955e858bbb 100644 (file)
         "fastq": "^1.6.0"
       }
     },
+    "@rollup/plugin-babel": {
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.0.2.tgz",
+      "integrity": "sha512-GiL7jL+FGppzQ1Sn4y2ER4UYXlgXFFEt+sHm4WJEzQwI76Yf9oy2QDqIvcon6xApZWlik3L8fezRGC6Mj2vRXg==",
+      "dev": true,
+      "requires": {
+        "@babel/helper-module-imports": "^7.7.4",
+        "@rollup/pluginutils": "^3.0.8"
+      }
+    },
     "@rollup/plugin-commonjs": {
       "version": "11.1.0",
       "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-11.1.0.tgz",
         }
       }
     },
-    "rollup-plugin-babel": {
-      "version": "4.4.0",
-      "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.4.0.tgz",
-      "integrity": "sha512-Lek/TYp1+7g7I+uMfJnnSJ7YWoD58ajo6Oarhlex7lvUce+RCKRuGRSgztDO3/MF/PuGKmUL5iTHKf208UNszw==",
-      "dev": true,
-      "requires": {
-        "@babel/helper-module-imports": "^7.0.0",
-        "rollup-pluginutils": "^2.8.1"
-      }
-    },
-    "rollup-pluginutils": {
-      "version": "2.8.2",
-      "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz",
-      "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==",
-      "dev": true,
-      "requires": {
-        "estree-walker": "^0.6.1"
-      },
-      "dependencies": {
-        "estree-walker": {
-          "version": "0.6.1",
-          "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz",
-          "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==",
-          "dev": true
-        }
-      }
-    },
     "run-async": {
       "version": "2.4.1",
       "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz",
index f0ec45bb816c99424477be18e45d21c773e71be4..94a83cb0ae84337f4e05b38c19f07f74bcb0eafb 100644 (file)
     "@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.7.6",
     "postcss-cli": "^7.1.1",
     "qunit": "2.9.2",
     "rollup": "^2.9.1",
-    "rollup-plugin-babel": "^4.4.0",
     "shelljs": "^0.8.4",
     "shx": "^0.3.2",
     "sinon": "^7.5.0",