Skip to content

Commit

Permalink
Use one unique index file as input on rollup.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoSot committed Jul 20, 2021
1 parent 2721f60 commit 9ddf086
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 40 deletions.
10 changes: 5 additions & 5 deletions build/rollup.config.js
Expand Up @@ -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
Expand All @@ -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"',
Expand All @@ -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`),
Expand Down
2 changes: 1 addition & 1 deletion js/index.esm.js → js/index.js
Expand Up @@ -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,
Expand Down
34 changes: 0 additions & 34 deletions js/index.umd.js

This file was deleted.

0 comments on commit 9ddf086

Please sign in to comment.