aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/build/rollup.config.js
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-07-29 09:31:47 +0000
committerMario <mario@mariovavti.com>2021-07-29 09:31:47 +0000
commitcb57c4ea188b982119f515f043a72f037f943025 (patch)
tree11144c1107f16047ed37f543fc34859d0c649e08 /vendor/twbs/bootstrap/build/rollup.config.js
parentc6133d2558ce29e44342fa7be8bb65e0059aea02 (diff)
parentb7ffec6fbe77eff3c550a922f50bd79321b293ed (diff)
downloadvolse-hubzilla-cb57c4ea188b982119f515f043a72f037f943025.tar.gz
volse-hubzilla-cb57c4ea188b982119f515f043a72f037f943025.tar.bz2
volse-hubzilla-cb57c4ea188b982119f515f043a72f037f943025.zip
Merge branch 'bs5' into 'dev'
Update to bootstrap 5 and implement next generation app menu (work in progress) See merge request hubzilla/core!1980
Diffstat (limited to 'vendor/twbs/bootstrap/build/rollup.config.js')
-rw-r--r--vendor/twbs/bootstrap/build/rollup.config.js38
1 files changed, 25 insertions, 13 deletions
diff --git a/vendor/twbs/bootstrap/build/rollup.config.js b/vendor/twbs/bootstrap/build/rollup.config.js
index e2d2b125e..8cecec9aa 100644
--- a/vendor/twbs/bootstrap/build/rollup.config.js
+++ b/vendor/twbs/bootstrap/build/rollup.config.js
@@ -3,12 +3,14 @@
const path = require('path')
const { babel } = require('@rollup/plugin-babel')
const { nodeResolve } = require('@rollup/plugin-node-resolve')
+const replace = require('@rollup/plugin-replace')
const banner = require('./banner.js')
const BUNDLE = process.env.BUNDLE === 'true'
+const ESM = process.env.ESM === 'true'
-let fileDest = 'bootstrap.js'
-const external = ['jquery', 'popper.js']
+let fileDest = `bootstrap${ESM ? '.esm' : ''}`
+const external = ['@popperjs/core']
const plugins = [
babel({
// Only transpile our source code
@@ -18,27 +20,37 @@ const plugins = [
})
]
const globals = {
- jquery: 'jQuery', // Ensure we use jQuery which is always available even in noConflict mode
- 'popper.js': 'Popper'
+ '@popperjs/core': 'Popper'
}
if (BUNDLE) {
- fileDest = 'bootstrap.bundle.js'
+ fileDest += '.bundle'
// Remove last entry in external array to bundle Popper
external.pop()
- delete globals['popper.js']
- plugins.push(nodeResolve())
+ delete globals['@popperjs/core']
+ plugins.push(
+ replace({
+ 'process.env.NODE_ENV': '"production"',
+ preventAssignment: true
+ }),
+ nodeResolve()
+ )
}
-module.exports = {
- input: path.resolve(__dirname, '../js/index.js'),
+const rollupConfig = {
+ input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`),
output: {
banner,
- file: path.resolve(__dirname, `../dist/js/${fileDest}`),
- format: 'umd',
- globals,
- name: 'bootstrap'
+ file: path.resolve(__dirname, `../dist/js/${fileDest}.js`),
+ format: ESM ? 'esm' : 'umd',
+ globals
},
external,
plugins
}
+
+if (!ESM) {
+ rollupConfig.output.name = 'bootstrap'
+}
+
+module.exports = rollupConfig