Dre
Dre3w 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
4 Replies
HewloThere
HewloThere3w 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
Dre3w 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/"
}
Ti/o
Ti/o2d ago
Is there a solution on how we can use a package with a file path? Or do I have to publish it every time I want to test a small change?