-
Notifications
You must be signed in to change notification settings - Fork 96
fix(browser-resolve): fix regressions from refactor #133
fix(browser-resolve): fix regressions from refactor #133
Conversation
f00c623
to
f0258b6
Compare
Im not entirely sure, but looking at the source code for a brief moment it seems that this PR is focused on supporting {
"main": "index.js",
"browser": {
"./index.js": "./browser.js",
"./nested/dep.js": "./nested/browser-dep.js",
"test": "./browser-test.js"
}
} And im not sure if this PR fixes that. I'd suspect We could go even further and check what gets resolved if we omit "main" entirely and leave just "browser" field with relative paths and nested relative paths. I'd suspect at least one of those cases won't work. |
Cool, haven't realized that those 2 are separate underlaying issues.
Im only wondering if this one wouldnt be overally a better fix for the whole issue. Even if they do not merge it, ur fork could be released under a new package name - or you could even ask npm for package 'takeover' if the original package is in fact unmaintained. Inlining this here seems like a duplicated effort - other tools could benefit from this being a separate package. |
f0258b6
to
7529f70
Compare
I did look into this, but it added too much bureaucratic complexity. Admittedly there were some regressions but this solution here is still only a handful of lines that are integrated into node-resolve. As a standalone package it would be much larger. I didn't consider it a worthwhile endeavor. |
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.
Im not a rollup org member, but the code looks good to me and fixes reported issues.
@Andarist, @keithamus For this issue, actually we just need provide a path filter option For more about resolve module options, see: |
Respect `browser` field configuration in case of implicit `main`
This has been updated to cover some additional usecases @mislav found. This should be very robust now I believe.I'm very confident in this PR. |
released as 3.0.3, thanks! |
This should fix #130 and #131, with tests added for each regression.