Skip to content

Commit

Permalink
chore: add comment about esbuild's bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Aug 25, 2023
1 parent b38fff6 commit dc58a74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion playground/lib/__tests__/lib.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ describe.runIf(isBuild)('build', () => {
'dist/nominify/my-lib-custom-filename.iife.js',
)
// esbuild helpers are injected inside of the IIFE wrapper
expect(code).toMatch(/^var MyLib=function\(\)\{(.*?)"use strict";/)
// esbuild has a bug that injects some statements before `"use strict"`: https://github.com/evanw/esbuild/issues/3322
// remove the `.*?` part once it's fixed
expect(code).toMatch(/^var MyLib=function\(\)\{.*?"use strict";/)
expect(noMinifyCode).toMatch(
/^var MyLib\s*=\s*function\(\)\s*\{.*?"use strict";/s,
)
Expand Down

0 comments on commit dc58a74

Please sign in to comment.