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:
parent
e7657c8bc0
commit
dda31bbee6
2 changed files with 17 additions and 17 deletions
|
@ -135,23 +135,24 @@ function getConfigByPluginKey(pluginKey) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function build(plugin) {
|
const utilObjects = [
|
||||||
console.log(`Building ${plugin} plugin...`)
|
|
||||||
|
|
||||||
const { external, globals } = getConfigByPluginKey(plugin)
|
|
||||||
let pluginPath = rootPath
|
|
||||||
|
|
||||||
const utilObjects = [
|
|
||||||
'Util',
|
'Util',
|
||||||
'Sanitizer'
|
'Sanitizer'
|
||||||
]
|
]
|
||||||
|
|
||||||
const domObjects = [
|
const domObjects = [
|
||||||
'Data',
|
'Data',
|
||||||
'EventHandler',
|
'EventHandler',
|
||||||
'Manipulator',
|
'Manipulator',
|
||||||
'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))
|
||||||
|
|
|
@ -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',
|
||||||
|
|
Loading…
Reference in a new issue