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

Cannot use loader: { '.js': 'copy' } #3041

Closed
somebody1234 opened this issue Apr 5, 2023 · 3 comments
Closed

Cannot use loader: { '.js': 'copy' } #3041

somebody1234 opened this issue Apr 5, 2023 · 3 comments

Comments

@somebody1234
Copy link

I need it because the JS files are build outputs, not build inputs.
(esbuild is still used to transpile TS)
Go panics with interface conversion: graph.InputFileRepr is *graph.CopyRepr, not *graph.JSRepr on this line:

otherRepr := otherFile.InputFile.Repr.(*graph.JSRepr)

@evanw
Copy link
Owner

evanw commented Apr 5, 2023

Please provide a self-contained way to reproduce the issue.

@somebody1234
Copy link
Author

upon further testing this is caused by https://www.npmjs.com/package/@esbuild-plugins/node-globals-polyfill. not sure what's the exact cause though...

@somebody1234
Copy link
Author

found the issue. minimal repro:

touch a.ts; touch b.js; npx esbuild --outfile=c --loader:.js=copy a.ts --inject:b.js

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