-
-
Notifications
You must be signed in to change notification settings - Fork 613
fix(node-resolve): do not ignore exceptions #564
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
Merged
shellscape
merged 11 commits into
rollup:master
from
tjenkinson:do-not-ignore-exceptions
Oct 25, 2020
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
39c9ce1
do not ignore errors
tjenkinson b456520
do not error when import specifier does not map to file
tjenkinson d78fa0f
always swallow MODULE_NOT_FOUND errors
tjenkinson 81890b7
return null from resolveId early if can't resolve
tjenkinson edffa14
strip null byte from importer if there is one
tjenkinson b4daacd
fix root-dir test
tjenkinson b321a7d
remove try/catch
tjenkinson 44227e4
use async exists() and realpath()
tjenkinson 3c7b64a
Merge remote-tracking branch 'upstream/master' into do-not-ignore-exc…
tjenkinson 26f9bd2
pretend importer is `undefined` if it starts will \0
tjenkinson 994ab6b
return null if file not found with modulesOnly option
tjenkinson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -7,11 +7,9 @@ const { testBundle } = require('../../../util/test'); | |
|
|
||
| const { nodeResolve } = require('..'); | ||
|
|
||
| process.chdir(join(__dirname, 'fixtures', 'monorepo-dedupe', 'packages', 'package-a')); | ||
|
|
||
| test('deduplicates modules from the given root directory', async (t) => { | ||
| const bundle = await rollup({ | ||
| input: 'index.js', | ||
| input: './packages/package-a/index.js', | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was causing an error because the input could not be found. It should be relative to the |
||
| plugins: [ | ||
| nodeResolve({ | ||
| dedupe: ['react'], | ||
|
|
||
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.
not sure if there's a better way to handle this case?
If you remove this change you'll see the
pkg.browser with mapping to prevent bundle by specifying a value of falsetest fail because the call toresolveIdwith the null byte is not allowedThere 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.
That one is a really good question that got overlooked so far. I do not agree with the solution, though. Files starting with
\0are under the sole maintenance of some plugin, and we should not make assumptions about what the part behind the\0means.I think a valid approach might be to treat the importer like
undefined, which is the value that gets passed for entry points. At least for the commonjs plugin, this should work nicely as all imports from those proxy files are fully resolved absolute paths anyway, and I would expect the same from other plugins as well.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.
@lukastaegert I pushed a commit to do this