]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Tweak rollup.config.js
authorXhmikosR <xhmikosr@gmail.com>
Fri, 1 Mar 2019 22:50:31 +0000 (00:50 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Mon, 11 Mar 2019 15:59:08 +0000 (17:59 +0200)
build/rollup.config.js

index 9475844c92caa0a6620bc146bf47c2fc80604880..e04e9d8047e89e44be043b0a764b6a03350634a4 100644 (file)
@@ -8,8 +8,7 @@ const banner = require('./banner.js')
 const BUNDLE = process.env.BUNDLE === 'true'
 const ESM = process.env.ESM === 'true'
 
-let fileDest = `bootstrap${ESM ? '.esm' : ''}.js`
-const indexPath = ESM ? '../js/index.esm.js' : '../js/index.umd.js'
+let fileDest = `bootstrap${ESM ? '.esm' : ''}`
 const external = ['popper.js']
 const plugins = [
   babel({
@@ -30,7 +29,7 @@ const globals = {
 }
 
 if (BUNDLE) {
-  fileDest = `bootstrap${ESM ? '.esm' : ''}.bundle.js`
+  fileDest += '.bundle'
   // Remove last entry in external array to bundle Popper
   external.pop()
   delete globals['popper.js']
@@ -38,10 +37,10 @@ if (BUNDLE) {
 }
 
 const rollupConfig = {
-  input: path.resolve(__dirname, indexPath),
+  input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`),
   output: {
     banner,
-    file: path.resolve(__dirname, `../dist/js/${fileDest}`),
+    file: path.resolve(__dirname, `../dist/js/${fileDest}.js`),
     format: ESM ? 'esm' : 'umd',
     globals
   },