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
Fix: load .env value also if entry target is specified with source
value in package.json
#7537
Merged
mischnic
merged 30 commits into
parcel-bundler:v2
from
Shinyaigeek:fix/inline-env-file-with-source-package-entry
Apr 15, 2022
+32
−2
Merged
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
84aede1
Fix: make each entry file refers some (virtual) file before getRootDir
Shinyaigeek bb1b902
Chore: add test case for .env with entry specified with package.source
Shinyaigeek d4170d0
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 4ce447e
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 1627b1c
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 6746fdf
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 82dad6d
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 0eda1b7
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek bb4b78c
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 79f6d76
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 81c3e8f
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek a725a6f
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 1b22141
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 5ea84ce
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek ec835d7
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 4dcae5c
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 6dd6df7
Update packages/core/integration-tests/test/javascript.js
Shinyaigeek 4b2d4a6
Update: only resolve index when entry is file
Shinyaigeek d5fda50
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 7ea8c51
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 6c370bc
Update packages/core/core/src/resolveOptions.js
mischnic 6d0ccf2
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 7c9d5a8
Update: handle entries specified with source in a specific case for perf
Shinyaigeek 1201d63
Update packages/core/core/src/resolveOptions.js
mischnic 8aae3df
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 4491fde
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 9c00171
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek aa4b037
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
Shinyaigeek 9d11e6d
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
mischnic 6ce5845
Merge branch 'v2' into fix/inline-env-file-with-source-package-entry
mischnic File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/core/integration-tests/test/integration/env-file-with-package-source/.env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FOO=bar | ||
BAR=test |
1 change: 1 addition & 0 deletions
1
packages/core/integration-tests/test/integration/env-file-with-package-source/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = process.env.FOO + process.env.BAR; |
4 changes: 4 additions & 0 deletions
4
packages/core/integration-tests/test/integration/env-file-with-package-source/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "env-file-with-package-source", | ||
"source": "index.js" | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would break if you have extensionless entries (which should work fine right now if there's a matching glob in parcelrc).
So maybe something like this instead?
(and use
path.join(entry, 'index')
instead of./
. This pattern is used in various places, for example also when determining the projectRoot a few lines further down)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! As you said, it is better to use
stat
than to judge with extension. I fixed in 4b2d4a6 👍