feat: using mjs entry for sub packages (#10626)

This commit is contained in:
neverland
2022-05-22 20:49:09 +08:00
committed by GitHub
parent 173a364dae
commit 90deb2439f
4 changed files with 5 additions and 4 deletions

View File

@@ -1,7 +1,8 @@
const { build } = require('esbuild');
function bundleBundle(format) {
const outfile = `dist/index.${format}.js`;
const ext = format === 'esm' ? '.mjs' : '.js';
const outfile = `dist/index.${format}${ext}`;
const finish = () => console.log('Build finished:', outfile);
const onRebuild = (error) => (error ? console.log(error) : finish());