Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esbuild@0.15.3 inserts the "use strict"; directive before the configured banner #2467

Closed
merceyz opened this issue Aug 14, 2022 · 1 comment

Comments

@merceyz
Copy link

merceyz commented Aug 14, 2022

Describe the bug

Starting in esbuild@0.14.44, esbuild inserts the "use strict"; directive before the configured banner.

Ref yarnpkg/berry#4732

To Reproduce

docker run --rm -it node:16.16.0 bash
cd $(mktemp -d)
yarn init -2
yarn set version 3.2.2
yarn add esbuild@0.15.3
printf '{"compilerOptions": {"strict": true}}' > tsconfig.json
printf "console.log(42)" > foo.js
yarn esbuild --banner:js='#!/usr/bin/env node' ./foo.js | node
@evanw
Copy link
Owner

evanw commented Aug 14, 2022

Ah ok, I can make this work. FWIW the current way to use a hashbang is to put it in the entry point source file.

@evanw evanw closed this as completed in 6d4f902 Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants