support all config file extensions (.js,.mjs,...)#3204
support all config file extensions (.js,.mjs,...)#3204lukastaegert merged 3 commits intorollup:masterfrom arlac77:master
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3204 +/- ##
==========================================
+ Coverage 90.63% 90.63% +<.01%
==========================================
Files 167 167
Lines 5905 5906 +1
Branches 1792 1792
==========================================
+ Hits 5352 5353 +1
Misses 336 336
Partials 217 217
Continue to review full report at Codecov.
|
lukastaegert
left a comment
There was a problem hiding this comment.
Test and doc changes look good, but I wonder if we might solve similar issues once and for all by allowing every extension, see my suggestion.
| defaultLoader(module, filename); | ||
| } | ||
| }; | ||
| const extensions = ['.js','.mjs']; |
There was a problem hiding this comment.
This will work nicely for '.js' and '.mjs' but not other extensions, and is slightly complicated. How about this: As we KNOW the name of the config file, how about using path.extname to extract the extension of the config file and just modify the loader for this extension?
There was a problem hiding this comment.
makes perfect sense
lukastaegert
left a comment
There was a problem hiding this comment.
Thanks a lot, this looks really nice now!
|
I am trying to use this and I am calling like... but I get...
Notice it seems to be using the cjs loader still. |
|
looks like this does work (lerna and my node_modules is in root for dev deps) Is there a way to import without needing the relative path? |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers: #3189
Description
support naming the config file *.mjs