aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/build/rollup.config.mjs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-10-05 10:17:07 +0000
committerMario <mario@mariovavti.com>2023-10-05 10:17:07 +0000
commit32f2de17d4faeb7b74b0f1b46c43800e3acedf36 (patch)
tree002328a2aad702ba3b7068992337f8aa2bb59997 /vendor/twbs/bootstrap/build/rollup.config.mjs
parent600e8081a82f088ff513664379a1557ae5078193 (diff)
downloadvolse-hubzilla-32f2de17d4faeb7b74b0f1b46c43800e3acedf36.tar.gz
volse-hubzilla-32f2de17d4faeb7b74b0f1b46c43800e3acedf36.tar.bz2
volse-hubzilla-32f2de17d4faeb7b74b0f1b46c43800e3acedf36.zip
composer update bootstrap
Diffstat (limited to 'vendor/twbs/bootstrap/build/rollup.config.mjs')
-rw-r--r--vendor/twbs/bootstrap/build/rollup.config.mjs59
1 files changed, 59 insertions, 0 deletions
diff --git a/vendor/twbs/bootstrap/build/rollup.config.mjs b/vendor/twbs/bootstrap/build/rollup.config.mjs
new file mode 100644
index 000000000..dd6c7d13e
--- /dev/null
+++ b/vendor/twbs/bootstrap/build/rollup.config.mjs
@@ -0,0 +1,59 @@
+import path from 'node:path'
+import process from 'node:process'
+import { fileURLToPath } from 'node:url'
+import { babel } from '@rollup/plugin-babel'
+import { nodeResolve } from '@rollup/plugin-node-resolve'
+import replace from '@rollup/plugin-replace'
+import banner from './banner.mjs'
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
+
+const BUNDLE = process.env.BUNDLE === 'true'
+const ESM = process.env.ESM === 'true'
+
+let destinationFile = `bootstrap${ESM ? '.esm' : ''}`
+const external = ['@popperjs/core']
+const plugins = [
+ babel({
+ // Only transpile our source code
+ exclude: 'node_modules/**',
+ // Include the helpers in the bundle, at most one copy of each
+ babelHelpers: 'bundled'
+ })
+]
+const globals = {
+ '@popperjs/core': 'Popper'
+}
+
+if (BUNDLE) {
+ destinationFile += '.bundle'
+ // Remove last entry in external array to bundle Popper
+ external.pop()
+ delete globals['@popperjs/core']
+ plugins.push(
+ replace({
+ 'process.env.NODE_ENV': '"production"',
+ preventAssignment: true
+ }),
+ nodeResolve()
+ )
+}
+
+const rollupConfig = {
+ input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`),
+ output: {
+ banner: banner(),
+ file: path.resolve(__dirname, `../dist/js/${destinationFile}.js`),
+ format: ESM ? 'esm' : 'umd',
+ globals,
+ generatedCode: 'es2015'
+ },
+ external,
+ plugins
+}
+
+if (!ESM) {
+ rollupConfig.output.name = 'bootstrap'
+}
+
+export default rollupConfig