I have a server-only export that I name index.server.ts. I want this file to be renamed server.js so that import foobar from "my-package/server points to this file.
If I set an output filename in Webpack like this:
{
outuput: {
filename: "server.js"
}
}
The filename will be server.js, but the type declaration stays index.server.d.ts, therefore the import from other TypeScript packages fails, because TypeScript cannot find the right declaration file.
Any idea what's the expected behaviour/how to bypass this?