aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/build/rollup.config.js
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-09-08 07:43:40 +0000
committerMario <mario@mariovavti.com>2021-09-08 07:43:40 +0000
commit4c5f0a05c75cc66113f589a3ffe6df351abb1273 (patch)
tree15148d08a99f8375992e554a90e6d4333286a7cc /vendor/twbs/bootstrap/build/rollup.config.js
parent952407363e245d41986cfb90e4ccf509bddc7322 (diff)
parent977a55eb8423745e4d88257b704d3e36f7337b9f (diff)
downloadvolse-hubzilla-4c5f0a05c75cc66113f589a3ffe6df351abb1273.tar.gz
volse-hubzilla-4c5f0a05c75cc66113f589a3ffe6df351abb1273.tar.bz2
volse-hubzilla-4c5f0a05c75cc66113f589a3ffe6df351abb1273.zip
Merge branch '6.2RC'6.2
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