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,24 +135,25 @@ function getConfigByPluginKey(pluginKey) {
|
|||
}
|
||||
}
|
||||
|
||||
const utilObjects = [
|
||||
'Util',
|
||||
'Sanitizer'
|
||||
]
|
||||
|
||||
const domObjects = [
|
||||
'Data',
|
||||
'EventHandler',
|
||||
'Manipulator',
|
||||
'SelectorEngine'
|
||||
]
|
||||
|
||||
function build(plugin) {
|
||||
console.log(`Building ${plugin} plugin...`)
|
||||
|
||||
const { external, globals } = getConfigByPluginKey(plugin)
|
||||
const pluginFilename = path.basename(bsPlugins[plugin])
|
||||
let pluginPath = rootPath
|
||||
|
||||
const utilObjects = [
|
||||
'Util',
|
||||
'Sanitizer'
|
||||
]
|
||||
|
||||
const domObjects = [
|
||||
'Data',
|
||||
'EventHandler',
|
||||
'Manipulator',
|
||||
'SelectorEngine'
|
||||
]
|
||||
|
||||
if (utilObjects.includes(plugin)) {
|
||||
pluginPath = `${rootPath}/util/`
|
||||
}
|
||||
|
@ -161,8 +162,6 @@ function build(plugin) {
|
|||
pluginPath = `${rootPath}/dom/`
|
||||
}
|
||||
|
||||
const pluginFilename = `${plugin.toLowerCase()}.js`
|
||||
|
||||
rollup.rollup({
|
||||
input: bsPlugins[plugin],
|
||||
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([
|
||||
jqueryFile,
|
||||
'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/dom/polyfill.js',
|
||||
'js/coverage/dist/dom/eventHandler.js',
|
||||
|
@ -124,7 +124,7 @@ if (bundle) {
|
|||
files = files.concat([
|
||||
jqueryFile,
|
||||
'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/dom/polyfill.js',
|
||||
'js/coverage/dist/dom/eventHandler.js',
|
||||
|
|
Loading…
Reference in a new issue