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
feat: file extensions opt-in and lookup #4303
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4303 +/- ##
=======================================
Coverage 98.45% 98.45%
=======================================
Files 205 205
Lines 7311 7321 +10
Branches 2082 2085 +3
=======================================
+ Hits 7198 7208 +10
Misses 55 55
Partials 58 58
Continue to review full report at Codecov.
|
d05b709
to
e78d742
Compare
@dnalborczyk what is the state of this one? While I did not do a deep review yet, the proposal looks sound to me. |
eca6a6c
to
71d20c9
Compare
cbd94e6
to
f1538ce
Compare
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
resolves #4301
Todo:
string
option? (can also be given as single array value instead ['.js']Initially I thought to implement a
requireFileExtensions
(boolean) option, but I thought it might be better to re-use the same option for the extension lookup , which can also be specified now. similar to webpack resolve extensionsfalse (default)
currently an
opt-in
, and therefore non-breaking. in that case theinternal default extensions
would be used, which are currently['.mjs', '.js']
.true
all given file paths are expected to have a file extension. they are required.
string[] e.g. ['.js'], ['.js', '.mjs']
replaces the
default extensions
, which also include the order of file lookups, for example ['.js', '.mjs] would first look for.js
files, then for.mjs
files. it also means that file extensions are not required, but still allowed.personally I would strongly suggest to make this option an
opt-out
(default: true) for v3, as node.js, the web, and other engines (nginx, moddable etc.) work the same way (including I believe webpack). rollup seems to be the only one standing out.