Dre
Dre2w ago

local modules

working example in package.json ... "styled-components": "5.3.11", "moduleX": "file:./local_modules/moduleX/", .... this will install the module from a local source using npm or pnpm or bun, but it fails with deno
3 Replies
HewloThere
HewloThere2w ago
this should work?
{
"styled-components": "npm:styled-components@5.3.11",
"moduleX": "./local_modules/moduleX/<entry-file>.<extension>"
}
{
"styled-components": "npm:styled-components@5.3.11",
"moduleX": "./local_modules/moduleX/<entry-file>.<extension>"
}
i.e.
{
"styled-components": "npm:styled-components@5.3.11",
"foo-module": "./local_modules/foo-module/index.ts"
}
{
"styled-components": "npm:styled-components@5.3.11",
"foo-module": "./local_modules/foo-module/index.ts"
}
Dre
Dre2w ago
But it is a built module you see where it says file: <path> this file prefix is necessary the entry is the package.json
HewloThere
HewloThere2w ago
i don't think you can get the package.json exports to map out, but if you use the --unstable-sloppy-imports flag, it will find the appropriate index.* file if you just do this:
{
"foo-module": "./local_modules/foo-module/"
}
{
"foo-module": "./local_modules/foo-module/"
}