diff options
| author | Johann-S <[email protected]> | 2018-03-03 23:04:11 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2018-10-20 15:32:09 +0300 |
| commit | caefd7046372e954d21550bbdadcabf98b2a86f0 (patch) | |
| tree | 9e1835a7d61a8302c4dcaaff5b5a023efcae96b1 /build/rollup.config.js | |
| parent | bf573896472c83e2b85b52f6cbf606765b73cb3e (diff) | |
| download | bootstrap-caefd7046372e954d21550bbdadcabf98b2a86f0.tar.xz bootstrap-caefd7046372e954d21550bbdadcabf98b2a86f0.zip | |
Add touch support in our carousel with HammerJS.
Diffstat (limited to 'build/rollup.config.js')
| -rw-r--r-- | build/rollup.config.js | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/build/rollup.config.js b/build/rollup.config.js index c8acf7a9e..72e3951fa 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -1,12 +1,13 @@ -const path = require('path') -const babel = require('rollup-plugin-babel') -const resolve = require('rollup-plugin-node-resolve') -const banner = require('./banner.js') +const path = require('path') +const babel = require('rollup-plugin-babel') +const resolve = require('rollup-plugin-node-resolve') +const commonjs = require('rollup-plugin-commonjs') +const banner = require('./banner.js') const BUNDLE = process.env.BUNDLE === 'true' -let fileDest = 'bootstrap.js' -const external = ['jquery', 'popper.js'] +let fileDest = 'bootstrap.js' +const external = ['jquery', 'hammerjs', 'popper.js'] const plugins = [ babel({ exclude: 'node_modules/**', // Only transpile our source code @@ -21,15 +22,22 @@ const plugins = [ ] const globals = { jquery: 'jQuery', // Ensure we use jQuery which is always available even in noConflict mode + hammerjs: 'Hammer', 'popper.js': 'Popper' } if (BUNDLE) { fileDest = 'bootstrap.bundle.js' - // Remove last entry in external array to bundle Popper - external.pop() + // We just keep jQuery as external + external.length = 1 delete globals['popper.js'] - plugins.push(resolve()) + delete globals.hammerjs + plugins.push( + commonjs({ + include: 'node_modules/**' + }), + resolve() + ) } module.exports = { |
