1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-18 19:31:35 +02:00

Comply to the new rules.

This commit is contained in:
XhmikosR
2019-02-26 13:20:34 +02:00
parent 44e6abcba5
commit 46c037410b
44 changed files with 854 additions and 771 deletions

View File

@@ -7,16 +7,18 @@
'use strict'
const path = require('path')
const rollup = require('rollup')
const babel = require('rollup-plugin-babel')
const banner = require('./banner.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({
exclude: 'node_modules/**', // Only transpile our source code
externalHelpersWhitelist: [ // Include only required helpers
// Only transpile our source code
exclude: 'node_modules/**',
// Include only required helpers
externalHelpersWhitelist: [
'defineProperties',
'createClass',
'inheritsLoose',
@@ -147,9 +149,7 @@ function getConfigByPluginKey(pluginKey) {
function build(plugin) {
console.log(`Building ${plugin} plugin...`)
const config = getConfigByPluginKey(plugin)
const external = config.external
const globals = config.globals
const { external, globals } = getConfigByPluginKey(plugin)
let pluginPath = rootPath
const utilObjects = [
@@ -179,7 +179,7 @@ function build(plugin) {
input: bsPlugins[plugin],
plugins,
external
}).then((bundle) => {
}).then(bundle => {
bundle.write({
banner: banner(pluginFilename),
format: 'umd',
@@ -189,8 +189,8 @@ function build(plugin) {
file: path.resolve(__dirname, `${pluginPath}${pluginFilename}`)
})
.then(() => console.log(`Building ${plugin} plugin... Done!`))
.catch((err) => console.error(`${plugin}: ${err}`))
.catch(error => console.error(`${plugin}: ${error}`))
})
}
Object.keys(bsPlugins).forEach((plugin) => build(plugin))
Object.keys(bsPlugins).forEach(plugin => build(plugin))