({ input, external })
| 55 | } |
| 56 | |
| 57 | function esm({ input, external }) { |
| 58 | return { |
| 59 | // ESM |
| 60 | external, |
| 61 | input, |
| 62 | output: { |
| 63 | format: 'esm', |
| 64 | dir: `build/lib`, |
| 65 | sourcemap: true, |
| 66 | preserveModules: true, |
| 67 | entryFileNames: '[name].esm.js', |
| 68 | }, |
| 69 | plugins: [babelPlugin, commonJS(), nodeResolve({ extensions })], |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | function cjs({ input, external }) { |
| 74 | return { |