Skip to content

Commit 52575a2

Browse files
committed
fix: always generate esm-compatibility banner
1 parent 51d91ed commit 52575a2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/build.ts

+9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ async function build() {
1515
external: [],
1616
bundle: true,
1717
entryPoints: [path.join(srcPath, "index.ts")],
18+
banner: {
19+
js: `
20+
import { createRequire } from 'module';
21+
import { fileURLToPath } from 'url';
22+
const require = createRequire(import.meta.url);
23+
const __filename = fileURLToPath(import.meta.url);
24+
const __dirname = path.dirname(__filename);
25+
`,
26+
},
1827
outdir: buildPath,
1928
});
2029
}

0 commit comments

Comments
 (0)