0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-18 10:52:19 +01:00
Move babel whitelist helpers to a common file
This commit is contained in:
XhmikosR 2020-05-04 20:11:30 +03:00
parent d8691fcd5a
commit f3aed77dc7
3 changed files with 23 additions and 18 deletions

13
build/babel-helpers.js Normal file
View File

@ -0,0 +1,13 @@
'use strict'
// These are the babel helpers we whitelist
const helpers = [
'createClass',
'createSuper',
'defineProperties',
'defineProperty',
'inheritsLoose',
'objectSpread2'
]
module.exports = helpers

View File

@ -11,19 +11,15 @@ 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 TEST = process.env.NODE_ENV === 'test'
const plugins = [
babel({
exclude: 'node_modules/**', // Only transpile our source code
externalHelpersWhitelist: [ // Include only required helpers
'defineProperties',
'createClass',
'createSuper',
'inheritsLoose',
'defineProperty',
'objectSpread2'
]
// Only transpile our source code
exclude: 'node_modules/**',
// Include only required helpers
externalHelpersWhitelist: babelHelpers
})
]
const bsPlugins = {

View File

@ -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'
@ -11,15 +12,10 @@ let fileDest = 'bootstrap.js'
const external = ['jquery', 'popper.js']
const plugins = [
babel({
exclude: 'node_modules/**', // Only transpile our source code
externalHelpersWhitelist: [ // Include only required helpers
'defineProperties',
'createClass',
'createSuper',
'inheritsLoose',
'defineProperty',
'objectSpread2'
]
// Only transpile our source code
exclude: 'node_modules/**',
// Include only required helpers
externalHelpersWhitelist: babelHelpers
})
]
const globals = {