Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2019-02-23 01:37:55 +0300
committerXhmikosR <xhmikosr@gmail.com>2019-02-26 14:04:04 +0300
commit8a37045b798fd66ede9c68774f9bb657e28d956a (patch)
tree35a1cf1b26701975f9732e99553e53fb295678c7 /build/build-plugins.js
parent8affe84c722bc459e7152e57d36a4f515f537abf (diff)
move util in a util folder with the sanitizer
Diffstat (limited to 'build/build-plugins.js')
-rw-r--r--build/build-plugins.js63
1 files changed, 33 insertions, 30 deletions
diff --git a/build/build-plugins.js b/build/build-plugins.js
index cabd44e455..1339684963 100644
--- a/build/build-plugins.js
+++ b/build/build-plugins.js
@@ -41,23 +41,25 @@ const bsPlugins = {
ScrollSpy: path.resolve(__dirname, '../js/src/scrollspy.js'),
Tab: path.resolve(__dirname, '../js/src/tab.js'),
Toast: path.resolve(__dirname, '../js/src/toast.js'),
- Tooltip: path.resolve(__dirname, '../js/src/tooltip.js'),
- Util: path.resolve(__dirname, '../js/src/util.js')
+ Tooltip: path.resolve(__dirname, '../js/src/tooltip.js')
}
const rootPath = TEST ? '../js/coverage/dist/' : '../js/dist/'
+if (TEST) {
+ bsPlugins.Util = path.resolve(__dirname, '../js/src/util/index.js')
+ bsPlugins.Sanitizer = path.resolve(__dirname, '../js/src/util/sanitizer.js')
+}
+
const defaultPluginConfig = {
external: [
bsPlugins.Data,
bsPlugins.EventHandler,
- bsPlugins.SelectorEngine,
- bsPlugins.Util
+ bsPlugins.SelectorEngine
],
globals: {
[bsPlugins.Data]: 'Data',
[bsPlugins.EventHandler]: 'EventHandler',
- [bsPlugins.SelectorEngine]: 'SelectorEngine',
- [bsPlugins.Util]: 'Util'
+ [bsPlugins.SelectorEngine]: 'SelectorEngine'
}
}
@@ -65,7 +67,9 @@ function getConfigByPluginKey(pluginKey) {
if (
pluginKey === 'Data' ||
pluginKey === 'Manipulator' ||
- pluginKey === 'Util'
+ pluginKey === 'Polyfill' ||
+ pluginKey === 'Util' ||
+ pluginKey === 'Sanitizer'
) {
return {
external: [],
@@ -76,21 +80,10 @@ function getConfigByPluginKey(pluginKey) {
if (pluginKey === 'EventHandler' || pluginKey === 'SelectorEngine') {
return {
external: [
- bsPlugins.Polyfill,
- bsPlugins.Util
+ bsPlugins.Polyfill
],
globals: {
- [bsPlugins.Polyfill]: 'Polyfill',
- [bsPlugins.Util]: 'Util'
- }
- }
- }
-
- if (pluginKey === 'Polyfill') {
- return {
- external: [bsPlugins.Util],
- globals: {
- [bsPlugins.Util]: 'Util'
+ [bsPlugins.Polyfill]: 'Polyfill'
}
}
}
@@ -125,14 +118,12 @@ function getConfigByPluginKey(pluginKey) {
external: [
bsPlugins.Data,
bsPlugins.SelectorEngine,
- bsPlugins.Tooltip,
- bsPlugins.Util
+ bsPlugins.Tooltip
],
globals: {
[bsPlugins.Data]: 'Data',
[bsPlugins.SelectorEngine]: 'SelectorEngine',
- [bsPlugins.Tooltip]: 'Tooltip',
- [bsPlugins.Util]: 'Util'
+ [bsPlugins.Tooltip]: 'Tooltip'
}
}
}
@@ -142,14 +133,12 @@ function getConfigByPluginKey(pluginKey) {
external: [
bsPlugins.Data,
bsPlugins.EventHandler,
- bsPlugins.Manipulator,
- bsPlugins.Util
+ bsPlugins.Manipulator
],
globals: {
[bsPlugins.Data]: 'Data',
[bsPlugins.EventHandler]: 'EventHandler',
- [bsPlugins.Manipulator]: 'Manipulator',
- [bsPlugins.Util]: 'Util'
+ [bsPlugins.Manipulator]: 'Manipulator'
}
}
}
@@ -161,14 +150,28 @@ function build(plugin) {
const config = getConfigByPluginKey(plugin)
const external = config.external
const globals = config.globals
+ let pluginPath = rootPath
+
+ const utilObjects = [
+ 'Util',
+ 'Sanitizer'
+ ]
- const pluginPath = [
+ const domObjects = [
'Data',
'EventHandler',
'Manipulator',
'Polyfill',
'SelectorEngine'
- ].includes(plugin) ? `${rootPath}/dom/` : rootPath
+ ]
+
+ if (utilObjects.includes(plugin)) {
+ pluginPath = `${rootPath}/util/`
+ }
+
+ if (domObjects.includes(plugin)) {
+ pluginPath = `${rootPath}/dom/`
+ }
const pluginFilename = `${plugin.toLowerCase()}.js`