Closed mtth closed 8 years ago
Just to make sure I understand this change. Previously a browser field value of:
browser: {
"./local-file.js": false
}
Would not work when required from another module (require(foo/local-file)
) because the path would not be expanded? And this PR fixes that behavior?
This is for require
s inside the same package. Assuming the following folder structure (a bit contrived for simplicity):
index.js
(with require('./lib/hide')
)lib/
index.js
(with require('./hide')
)hide.js
(should be always skipped for browser builds)In this case, we have to set both ./hide
and ./lib/hide
to false
in package.json
(which wouldn't be the case if they were just relocated):
browser: {
"./hide": false,
"./lib/hide": false
}
With this change, skipped keys behave the same as relocated ones. Hope this makes sense.
Makes perfect sense. Great fix!
Path keys corresponding to skipped paths (where the value is
false
) did not get expanded, so only module IDs were supported. This lets us skip relative paths as well.