Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The Test Snapshot
esbuild plugin with JSX 3
contains:data.url
of/_.._/esbuild_jsx/main.js
and nosrc
connection/main.jsx
without any transformations and with asrc
connectionThis is not the desired output. It should look something like this:
/main.js
bundle with asrc
connectionThis happens because the esbuild plugin (accidentally ?) modifies their plugin defaults:
This way the
absWorkingDir
option leaks from the first esbuild test to the other tests. All the esbuild tests usetest/assets/esbuild
as src -- except theesbuild plugin with JSX
test which uses thetest/assets/esbuild_jsx
dir. However, because of the option leak we configure esbuild with aabsWorkingDir
oftest/assets/esbuild
instead oftest/assets/esbuild_jsx
. Mapping of esbuild output files fails and the output JS is added as a chunk. The/_.._/
part seems to be an "escaped"/../
.You can verify this by running all the esbuild tests (without the PR patch):
deno task test ./tests/esbuild.test.ts
- they should all passAnd then run only the
esbuild plugin with JSX
test (without the PR patch):deno task test ./tests/esbuild.test.ts --filter '/^esbuild plugin with JSX$/'
- this should fail and the diff should display the changes mentioned above (actual / desired output)This PR changes the way the
absWorkingDir
option is handled to not modify the plugin defaults. I have also updated theesbuild plugin with JSX 3
snapshot to reflect the desired data.This should not have any impact on actual users and does not change the output files of actual users. This bug only occurs when using the esbuild plugin multiple times but with a different
site.src
.Related Issues
None
Check List
CODE OF CONDUCT
CONTRIBUTING
send multiple pull request.
fmt
to fix the code format before commit.CHANGELOG.md
.