Open Poyoman39 opened 2 years ago
I don't know the exact way quibble is working internally. But it looks like the problem come from "dummyImportModuleToGetAtPath" function. When it try to "import", the original parentUrl context is lost, then package.json alias are lost too.
Paging @giltayar for help! 🙏
@Poyoman39 I'll look into it.
I'm not sure if this breaks anything, but there's a hacked out change here. It works for my case.
It's like this: Detect private mappings which always start with #
and resolve them against the calling package. Use import.meta.resolve
to do it. This only runs from a module so it's exposed through a global symbol. It also needs the new CLI flag --experimental-import-meta-resolve
.
node --experimental-import-meta-resolve --loader=quibble test.mjs
Hi quibble team,
I've a feature request. On my project i'm using import alias defined in my package.json like that :
It looks like quibble loader fails at managing such import. In my .test.js file i tried to replace alias path with
await td.replaceEsm('#src/dependencies');
this lead to the following error :TypeError [ERR_PACKAGE_IMPORT_NOT_DEFINED]: Package import specifier "#src/dependencies" is not defined in package /.../node_modules/quibble/package.json imported from /.../node_modules/quibble/lib/esm-import-functions.js
Full call stack :
I remain available if you need more information