chore/issue 557 resolve node modules using node require resolve#674
Conversation
5c9d315 to
8b40245
Compare
thescientist13
left a comment
There was a problem hiding this comment.
Might hold this back for the next release instead of going out with theme packs and 0.15.0 just to avoid too many big changes happening at once? Will see.
|
Made another issue to evaluate pushing this idea forward more if it indeed does workout. 🙌 |
b168641 to
78ae84b
Compare
|
I wonder if this means we can remove all the setup work on our specs now that requires copy / pasting files out of root node_modules into the test cases directory? 🤔 edit: maybe for the files in node_modules, but I still think it's needed for at least package.json for Greenwood to build up the initial import map? I guess experimenting to test would be OK, but maybe that kind of refactoring can be saved for later? May be merge this and then alpha to validate? |
78ae84b to
30b5e19
Compare
Related Issue
resolves #557
Summary of Changes
require.resolveinstead of assuming where node_modules is located on disk (in an effort to better handle npx commands showing error for not found node modules paths #505 / Bug/issue 505 improve default npx support #511 type situations)require.resolveblows up like happened for our theme pack specs (should see if I can mock this better or make an issue / discussion)Was able to confirm things seem to be working as expected now that we are using
require.resolvein thenpxtest case by changing the content to say<h2>hello require.resolve</h2>TODO
npxtest case to not require unpkg fallback and / or figure out a way to test locally@scoped-packages/something/else- reached out in NodeJS slack, will see, but I think it would definitely be an edge casewalkModule? - maybe for another PR / discussion