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

Handle case where users use esbuild + bundle: true #562

Open
lforst opened this issue Apr 17, 2024 · 7 comments
Open

Handle case where users use esbuild + bundle: true #562

lforst opened this issue Apr 17, 2024 · 7 comments

Comments

@lforst
Copy link
Member

lforst commented Apr 17, 2024

getsentry/sentry-javascript-bundler-plugins#445 (comment)

We need to solve this case ^

@Lms24
Copy link
Member

Lms24 commented Apr 17, 2024

Any thoughts how to solve this? I imagine we'd need to parse some kind of config for this?

@lforst
Copy link
Member Author

lforst commented Apr 18, 2024

I think as a first step, we could ask a question pretty early on "are you using bundle: true"? If so, we redirect to something like the CLI wizard. As a more involved solution we could try parsing the config, however I see that as very difficult since the configs are JS and could have runtime logic we can't statically infer.

@lforst
Copy link
Member Author

lforst commented Apr 18, 2024

Additionally, we could even potentially adjust the esbuild plugin to invoke the CLI with the inject command after the build has finished instead of injecting the debug ids as part of esbuild transpilation. That would definitely be a bit more error prone though.

@Lms24
Copy link
Member

Lms24 commented Apr 18, 2024

That would definitely be a bit more error prone though.

Not just error prone but also it would change the integrity hash of the script if change it afterwards. Service workers don't like that stuff xD This is always a problem with CLI inject so I wouldn't do it from within the bundler plugin by default.

@Lms24
Copy link
Member

Lms24 commented Apr 18, 2024

But agree, asking is a great first step! Slightly more involved: Have a heuristic that superficially checks for bundle keyword in esbuild config and only ask if it's found?

@lforst
Copy link
Member Author

lforst commented Apr 18, 2024

But agree, asking is a great first step! Slightly more involved: Have a heuristic that superficially checks for bundle keyword in esbuild config and only ask if it's found?

Would probably work, but it would run into issues in case the option is "imported" from somewhere else, like inside of a shared config object or something.

@Lms24
Copy link
Member

Lms24 commented Apr 18, 2024

hmm yeah you're right, let's just keep it simple 😅

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