2018-11-28 19:03:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								'use strict'
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-26 19:20:34 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const path = require('path')
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-26 11:14:12 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const { babel } = require('@rollup/plugin-babel')
							 | 
						
					
						
							
								
									
										
										
										
											2020-07-07 15:23:11 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const { nodeResolve } = require('@rollup/plugin-node-resolve')
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-19 16:17:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const replace = require('@rollup/plugin-replace')
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-26 19:20:34 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const banner = require('./banner.js')
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-16 20:00:38 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-26 19:20:34 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const BUNDLE = process.env.BUNDLE === 'true'
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-01 17:11:41 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const ESM = process.env.ESM === 'true'
							 | 
						
					
						
							
								
									
										
										
										
											2017-08-30 03:16:00 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-10-29 15:38:35 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								let fileDestination = `bootstrap${ESM ? '.esm' : ''}`
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-19 16:17:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const external = ['@popperjs/core']
							 | 
						
					
						
							
								
									
										
										
										
											2017-08-30 03:16:00 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								const plugins = [
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-15 16:40:49 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  babel({
							 | 
						
					
						
							
								
									
										
										
										
											2020-12-02 14:30:35 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // Only transpile our source code
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-15 16:40:49 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    exclude: 'node_modules/**',
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-26 11:14:12 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // Include the helpers in the bundle, at most one copy of each
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    babelHelpers: 'bundled'
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-15 16:40:49 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  })
							 | 
						
					
						
							
								
									
										
										
										
											2017-08-30 03:16:00 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								]
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								const globals = {
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-19 16:17:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  '@popperjs/core': 'Popper'
							 | 
						
					
						
							
								
									
										
										
										
											2017-08-30 03:16:00 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								if (BUNDLE) {
							 | 
						
					
						
							
								
									
										
										
										
											2021-10-29 15:38:35 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  fileDestination += '.bundle'
							 | 
						
					
						
							
								
									
										
										
										
											2018-10-14 19:59:51 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  // Remove last entry in external array to bundle Popper
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  external.pop()
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-19 16:17:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  delete globals['@popperjs/core']
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-11 00:47:42 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  plugins.push(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    replace({
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      'process.env.NODE_ENV': '"production"',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      preventAssignment: true
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    }),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    nodeResolve()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  )
							 | 
						
					
						
							
								
									
										
										
										
											2017-08-30 03:16:00 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-01 17:11:41 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const rollupConfig = {
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-02 06:50:31 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`),
							 | 
						
					
						
							
								
									
										
										
										
											2017-08-30 03:16:00 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  output: {
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-25 23:55:35 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    banner,
							 | 
						
					
						
							
								
									
										
										
										
											2021-10-29 15:38:35 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    file: path.resolve(__dirname, `../dist/js/${fileDestination}.js`),
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-01 17:11:41 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    format: ESM ? 'esm' : 'umd',
							 | 
						
					
						
							
								
									
										
										
										
											2021-10-05 00:46:07 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    globals,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    generatedCode: 'es2015'
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-31 08:03:22 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  },
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  external,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  plugins
							 | 
						
					
						
							
								
									
										
										
										
											2017-08-30 03:16:00 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-01 17:11:41 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								if (!ESM) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  rollupConfig.output.name = 'bootstrap'
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								module.exports = rollupConfig
							 |