1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

improve build plugin script to keep file name

This commit is contained in:
Johann-S 2019-05-08 16:38:05 +03:00 committed by XhmikosR
parent e7657c8bc0
commit dda31bbee6
2 changed files with 17 additions and 17 deletions

View file

@ -135,12 +135,6 @@ function getConfigByPluginKey(pluginKey) {
} }
} }
function build(plugin) {
console.log(`Building ${plugin} plugin...`)
const { external, globals } = getConfigByPluginKey(plugin)
let pluginPath = rootPath
const utilObjects = [ const utilObjects = [
'Util', 'Util',
'Sanitizer' 'Sanitizer'
@ -153,6 +147,13 @@ function build(plugin) {
'SelectorEngine' 'SelectorEngine'
] ]
function build(plugin) {
console.log(`Building ${plugin} plugin...`)
const { external, globals } = getConfigByPluginKey(plugin)
const pluginFilename = path.basename(bsPlugins[plugin])
let pluginPath = rootPath
if (utilObjects.includes(plugin)) { if (utilObjects.includes(plugin)) {
pluginPath = `${rootPath}/util/` pluginPath = `${rootPath}/util/`
} }
@ -161,8 +162,6 @@ function build(plugin) {
pluginPath = `${rootPath}/dom/` pluginPath = `${rootPath}/dom/`
} }
const pluginFilename = `${plugin.toLowerCase()}.js`
rollup.rollup({ rollup.rollup({
input: bsPlugins[plugin], input: bsPlugins[plugin],
plugins, plugins,
@ -181,4 +180,5 @@ function build(plugin) {
}) })
} }
Object.keys(bsPlugins).forEach(plugin => build(plugin)) Object.keys(bsPlugins)
.forEach(plugin => build(plugin))

View file

@ -99,7 +99,7 @@ if (bundle) {
files = files.concat([ files = files.concat([
jqueryFile, jqueryFile,
'js/tests/unit/tests-polyfills.js', 'js/tests/unit/tests-polyfills.js',
'js/coverage/dist/util/util.js', 'js/coverage/dist/util/index.js',
'js/coverage/dist/util/sanitizer.js', 'js/coverage/dist/util/sanitizer.js',
'js/coverage/dist/dom/polyfill.js', 'js/coverage/dist/dom/polyfill.js',
'js/coverage/dist/dom/eventHandler.js', 'js/coverage/dist/dom/eventHandler.js',
@ -124,7 +124,7 @@ if (bundle) {
files = files.concat([ files = files.concat([
jqueryFile, jqueryFile,
'js/tests/unit/tests-polyfills.js', 'js/tests/unit/tests-polyfills.js',
'js/coverage/dist/util/util.js', 'js/coverage/dist/util/index.js',
'js/coverage/dist/util/sanitizer.js', 'js/coverage/dist/util/sanitizer.js',
'js/coverage/dist/dom/polyfill.js', 'js/coverage/dist/dom/polyfill.js',
'js/coverage/dist/dom/eventHandler.js', 'js/coverage/dist/dom/eventHandler.js',