From b75b2f636e394d6dfacbcc3dd102b33c4f6fb3a0 Mon Sep 17 00:00:00 2001 From: Vlad Rusu Date: Wed, 16 Oct 2024 12:49:46 +0300 Subject: [PATCH] Various Bootstrap-version JS generation fixes --- build/rollup.config.mjs | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/build/rollup.config.mjs b/build/rollup.config.mjs index 0b10d0f11..651530880 100644 --- a/build/rollup.config.mjs +++ b/build/rollup.config.mjs @@ -23,8 +23,7 @@ const plugins = [ }) ] const globals = { - '@popperjs/core': 'Popper', - 'date-fns': 'dateFns' + '@popperjs/core': 'Popper' } if (BUNDLE) { @@ -32,21 +31,28 @@ if (BUNDLE) { // Remove last entry in external array to bundle Popper external.pop() delete globals['@popperjs/core'] - // Remove last entry in external array to bundle dateFns - external.pop() - delete globals['date-fns'] - plugins.push( - replace({ - 'process.env.NODE_ENV': '"production"', - preventAssignment: true, - ...BOOTSTRAP && { - 'coreui.': 'bs.' - } - }), - nodeResolve() - ) + plugins.push(nodeResolve()) } +plugins.push( + replace({ + 'process.env.NODE_ENV': '"production"', + preventAssignment: true, + ...BOOTSTRAP && { + delimiters: ['', ''], // disable word boundaries + '/coreui': '/coreui', // prevents https://coreui.io being replaced with https://bs.io + 'coreui.': 'bs.', + '.coreui': '.bs', + 'coreui-': 'bs-', + '-coreui': '-bs', + "'coreui'": "'bs'", // key.startsWith('coreui') => key.startsWith('bs') + 'coreuiConfig': 'bsConfig', // key.startsWith('coreuiConfig')) => key.startsWith('bsConfig')) + '^coreui': '^bs', // key.replace(/^coreui/, ''); => key.replace(/^bs/, ''); + 'coreui=': 'bs=', // [data-coreui="navigation"] => [data-bs="navigation"] (workaround for preventAssignment being true) + } + }) +) + const rollupConfig = { input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`), output: { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy