(format)
| 83 | * @param {"cjs" | "esm"} format - build format type |
| 84 | */ |
| 85 | export async function bundleByFormat(format) { |
| 86 | const esbuildFormat = format === 'mjs' ? 'esm' : format; |
| 87 | const esbuildExt = format === 'mjs' ? 'mjs' : 'js'; |
| 88 | |
| 89 | return runBuild({ |
| 90 | entryPoints: ['src/index.js'], |
| 91 | format: esbuildFormat, |
| 92 | target: 'es2020', |
| 93 | treeShaking: true, |
| 94 | define: { IIFE_ONLY: 'false' }, |
| 95 | outfile: `dist/${esbuildFormat}/index.${esbuildExt}`, |
| 96 | }); |
| 97 | } |
| 98 | |
| 99 | /** iife builds */ |
| 100 | export async function buildAllIifeFiles() { |
no test coverage detected