diff options
| author | GeoSot <[email protected]> | 2021-06-10 16:13:51 +0300 |
|---|---|---|
| committer | GeoSot <[email protected]> | 2021-07-20 14:03:18 +0300 |
| commit | 9ddf0864cb34c4cf825b063fa310136d2689cad3 (patch) | |
| tree | 09f67e37ea8a6899cf1ee8589b4b05700e00f87c | |
| parent | 2721f6042bc8106e35c3db21f382fc968bfce931 (diff) | |
| download | bootstrap-gs-use-only-one-file-as-input-on-rollup.config.tar.xz bootstrap-gs-use-only-one-file-as-input-on-rollup.config.zip | |
Use one unique index file as input on rollup.config.jsgs-use-only-one-file-as-input-on-rollup.config
| -rw-r--r-- | build/rollup.config.js | 10 | ||||
| -rw-r--r-- | js/index.js (renamed from js/index.esm.js) | 2 | ||||
| -rw-r--r-- | js/index.umd.js | 34 |
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 -} |
