| 1 | const fs = require('fs') |
| 2 | const path = require('path') |
| 3 | const babel = require('@rollup/plugin-babel') |
| 4 | |
| 5 | const inputFiles = fs.readdirSync('.').filter(file => file.endsWith('.js')); |
| 6 | |
| 7 | module.exports = inputFiles.map(file => ({ |
| 8 | input: file, |
| 9 | output: { |
| 10 | file: path.join('..','htdocs','static','js', file), |
| 11 | format: 'iife', |
| 12 | name: path.basename(file, '.js'), |
| 13 | extend: true, |
| 14 | }, |
| 15 | plugins: [babel({babelHelpers: 'bundled'})], |
| 16 | })); |