unjs / unenv

🕊️ Convert javaScript code to be runtime agnostic
MIT License
383 stars 20 forks source link

fix: allow mocking subpaths of proxy #46

Closed danielroe closed 2 years ago

danielroe commented 2 years ago

https://github.com/nuxt/nuxt.js/issues/13238, https://github.com/nuxt/nuxt.js/issues/14160

When something that has been aliased to proxy-cjs is accessed with a subpath, it falls back to the next valid subpath, which will never succeed: import (unenv/runtime/* => unenv/runtime/mock/proxy-cjs/.cjs).