aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/rollup.config.js10
-rw-r--r--js/index.js (renamed from js/index.esm.js)2
-rw-r--r--js/index.umd.js34
3 files changed, 6 insertions, 40 deletions
diff --git a/build/rollup.config.js b/build/rollup.config.js
index 8cecec9aa..4064f21b3 100644
--- a/build/rollup.config.js
+++ b/build/rollup.config.js
@@ -10,7 +10,7 @@ const BUNDLE = process.env.BUNDLE === 'true'
const ESM = process.env.ESM === 'true'
let fileDest = `bootstrap${ESM ? '.esm' : ''}`
-const external = ['@popperjs/core']
+let external = ['@popperjs/core']
const plugins = [
babel({
// Only transpile our source code
@@ -19,15 +19,15 @@ const plugins = [
babelHelpers: 'bundled'
})
]
-const globals = {
+let globals = {
'@popperjs/core': 'Popper'
}
if (BUNDLE) {
fileDest += '.bundle'
// Remove last entry in external array to bundle Popper
- external.pop()
- delete globals['@popperjs/core']
+ external = []
+ globals = {}
plugins.push(
replace({
'process.env.NODE_ENV': '"production"',
@@ -38,7 +38,7 @@ if (BUNDLE) {
}
const rollupConfig = {
- input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`),
+ input: path.resolve(__dirname, '../js/index.js'),
output: {
banner,
file: path.resolve(__dirname, `../dist/js/${fileDest}.js`),
diff --git a/js/index.esm.js b/js/index.js
index 61c70a3cc..c9ba1bbaf 100644
--- a/js/index.esm.js
+++ b/js/index.js
@@ -18,7 +18,7 @@ import Tab from './src/tab'
import Toast from './src/toast'
import Tooltip from './src/tooltip'
-export {
+export default {
Alert,
Button,
Carousel,
diff --git a/js/index.umd.js b/js/index.umd.js
deleted file mode 100644
index 068db8e70..000000000
--- a/js/index.umd.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * --------------------------------------------------------------------------
- * Bootstrap (v5.0.2): index.umd.js
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
- * --------------------------------------------------------------------------
- */
-
-import Alert from './src/alert'
-import Button from './src/button'
-import Carousel from './src/carousel'
-import Collapse from './src/collapse'
-import Dropdown from './src/dropdown'
-import Modal from './src/modal'
-import Offcanvas from './src/offcanvas'
-import Popover from './src/popover'
-import ScrollSpy from './src/scrollspy'
-import Tab from './src/tab'
-import Toast from './src/toast'
-import Tooltip from './src/tooltip'
-
-export default {
- Alert,
- Button,
- Carousel,
- Collapse,
- Dropdown,
- Modal,
- Offcanvas,
- Popover,
- ScrollSpy,
- Tab,
- Toast,
- Tooltip
-}