diff options
author | nobody <nobody@zotlabs.com> | 2021-08-25 19:13:31 -0700 |
---|---|---|
committer | nobody <nobody@zotlabs.com> | 2021-08-25 19:13:31 -0700 |
commit | aa2106f9495bee4dcf0701fbd9fec8de6fa44984 (patch) | |
tree | f2e7178f78311069bd54471f6c063c5901d16fb7 /vendor/twbs/bootstrap/build/rollup.config.js | |
parent | 73b53675b1a339cfd950845279438e35b4e2dc7c (diff) | |
parent | 6261d0826c49ca24df9f694931592fbb9bf60f7e (diff) | |
download | volse-hubzilla-aa2106f9495bee4dcf0701fbd9fec8de6fa44984.tar.gz volse-hubzilla-aa2106f9495bee4dcf0701fbd9fec8de6fa44984.tar.bz2 volse-hubzilla-aa2106f9495bee4dcf0701fbd9fec8de6fa44984.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'vendor/twbs/bootstrap/build/rollup.config.js')
-rw-r--r-- | vendor/twbs/bootstrap/build/rollup.config.js | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/vendor/twbs/bootstrap/build/rollup.config.js b/vendor/twbs/bootstrap/build/rollup.config.js index e2d2b125e..8cecec9aa 100644 --- a/vendor/twbs/bootstrap/build/rollup.config.js +++ b/vendor/twbs/bootstrap/build/rollup.config.js @@ -3,12 +3,14 @@ const path = require('path') const { babel } = require('@rollup/plugin-babel') const { nodeResolve } = require('@rollup/plugin-node-resolve') +const replace = require('@rollup/plugin-replace') const banner = require('./banner.js') const BUNDLE = process.env.BUNDLE === 'true' +const ESM = process.env.ESM === 'true' -let fileDest = 'bootstrap.js' -const external = ['jquery', 'popper.js'] +let fileDest = `bootstrap${ESM ? '.esm' : ''}` +const external = ['@popperjs/core'] const plugins = [ babel({ // Only transpile our source code @@ -18,27 +20,37 @@ const plugins = [ }) ] const globals = { - jquery: 'jQuery', // Ensure we use jQuery which is always available even in noConflict mode - 'popper.js': 'Popper' + '@popperjs/core': 'Popper' } if (BUNDLE) { - fileDest = 'bootstrap.bundle.js' + fileDest += '.bundle' // Remove last entry in external array to bundle Popper external.pop() - delete globals['popper.js'] - plugins.push(nodeResolve()) + delete globals['@popperjs/core'] + plugins.push( + replace({ + 'process.env.NODE_ENV': '"production"', + preventAssignment: true + }), + nodeResolve() + ) } -module.exports = { - input: path.resolve(__dirname, '../js/index.js'), +const rollupConfig = { + input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`), output: { banner, - file: path.resolve(__dirname, `../dist/js/${fileDest}`), - format: 'umd', - globals, - name: 'bootstrap' + file: path.resolve(__dirname, `../dist/js/${fileDest}.js`), + format: ESM ? 'esm' : 'umd', + globals }, external, plugins } + +if (!ESM) { + rollupConfig.output.name = 'bootstrap' +} + +module.exports = rollupConfig |