Skip to content

Commit 75ff912

Browse files
committed
fix
1 parent 3392856 commit 75ff912

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/plugin-assets-retry/scripts/postCompile.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,25 @@ async function compileRuntimeFile(filename) {
2424
__dirname,
2525
`../dist/runtime/${filename}.min.js`,
2626
);
27+
2728
const { code } = await transform(runtimeCode, {
2829
jsc: {
2930
target: 'es5',
3031
parser: {
3132
syntax: 'typescript',
3233
},
3334
},
35+
// Output script file to be used in `<script>` tag
3436
isModule: false,
3537
sourceFileName: sourceFilePath,
3638
});
39+
3740
const { code: minifiedRuntimeCode } = await minify(code, {
3841
ecma: 5,
42+
// allows SWC to mangle function names
3943
module: true,
4044
});
45+
4146
await Promise.all([
4247
writeFile(distPath, code),
4348
writeFile(distMinPath, minifiedRuntimeCode),

0 commit comments

Comments
 (0)