]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
improve build plugin script to keep file name
authorJohann-S <johann.servoire@gmail.com>
Wed, 8 May 2019 13:38:05 +0000 (16:38 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Wed, 8 May 2019 14:26:37 +0000 (17:26 +0300)
build/build-plugins.js
js/tests/karma.conf.js

index 8a2873341e4336945fb39ca59c48c93b6a1aaee3..0f68e1b0b6cabbeb988bced6c39a2d394d31e25b 100644 (file)
@@ -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))
index 276610b80173a7289eb1c1900608c70b20934bd4..2ab5655aa6bcbf2e0d24426586155ed4aadfb357 100644 (file)
@@ -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',