Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2020-05-04 20:08:28 +0300
committerGitHub <noreply@github.com>2020-05-04 20:08:28 +0300
commitdb80eb96fac9611dce440d225abc96823e758fbe (patch)
treeaa44c8d4ac4cb01d857c10c9b784627f8e9210f6 /build
parent56190d04dd3f52b27547537e8d80dd632ad495dc (diff)
Move babel whitelist helpers to a common file (#30723)
Diffstat (limited to 'build')
-rw-r--r--build/babel-helpers.js14
-rw-r--r--build/build-plugins.js11
-rw-r--r--build/rollup.config.js11
3 files changed, 18 insertions, 18 deletions
diff --git a/build/babel-helpers.js b/build/babel-helpers.js
new file mode 100644
index 0000000000..30a5156771
--- /dev/null
+++ b/build/babel-helpers.js
@@ -0,0 +1,14 @@
+'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 47527ed7b6..30c2c80179 100644
--- a/build/build-plugins.js
+++ b/build/build-plugins.js
@@ -11,21 +11,14 @@ 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 plugins = [
babel({
// Only transpile our source code
exclude: 'node_modules/**',
// Include only required helpers
- externalHelpersWhitelist: [
- 'createClass',
- 'createSuper',
- 'defineProperties',
- 'defineProperty',
- 'getPrototypeOf',
- 'inheritsLoose',
- 'objectSpread2'
- ]
+ externalHelpersWhitelist: babelHelpers
})
]
const bsPlugins = {
diff --git a/build/rollup.config.js b/build/rollup.config.js
index a7c3a6f5a4..d32346e101 100644
--- a/build/rollup.config.js
+++ b/build/rollup.config.js
@@ -4,6 +4,7 @@ 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 BUNDLE = process.env.BUNDLE === 'true'
const ESM = process.env.ESM === 'true'
@@ -15,15 +16,7 @@ const plugins = [
// Only transpile our source code
exclude: 'node_modules/**',
// Include only required helpers
- externalHelpersWhitelist: [
- 'createClass',
- 'createSuper',
- 'defineProperties',
- 'defineProperty',
- 'getPrototypeOf',
- 'inheritsLoose',
- 'objectSpread2'
- ]
+ externalHelpersWhitelist: babelHelpers
})
]
const globals = {