| 11 | import typescript from '@rollup/plugin-typescript'; |
| 12 | |
| 13 | const getConfig = (name) => ({ |
| 14 | input: 'src/generated-components/components/' + name + '.ts', |
| 15 | output: { |
| 16 | file: 'docs/' + name + '.bundled.js', |
| 17 | format: 'esm', |
| 18 | }, |
| 19 | onwarn(warning) { |
| 20 | if (warning.code !== 'THIS_IS_UNDEFINED') { |
| 21 | console.error(`(!) ${warning.message}`); |
| 22 | } |
| 23 | }, |
| 24 | plugins: [ |
| 25 | replace({'Reflect.decorate': 'undefined'}), |
| 26 | typescript(), |
| 27 | resolve(), |
| 28 | terser({ |
| 29 | ecma: 2017, |
| 30 | module: true, |
| 31 | warnings: true, |
| 32 | mangle: { |
| 33 | properties: { |
| 34 | regex: /^__/, |
| 35 | }, |
| 36 | }, |
| 37 | }), |
| 38 | summary(), |
| 39 | ], |
| 40 | }); |
| 41 | |
| 42 | export default [ |
| 43 | getConfig('hello-world'), |