One useful trick is to register the JS modules as an exports entry in package.json.
{
"name": "my-package",
"exports": {
"./js-impl": "./src/path/to/impl.js"
}
}
then you can use @module("my-package/js-impl")
Note that this relies on a feature of Node.js module resolution, so it will only work in ecosystems compatible with it (Node.js, Bun), and other standard ESM environments may need an additional import map to use this.