Is there a way to declare a different module name for a generated .d.ts
file?
tsc generates declare module "index" {
instead of declare module "@myorg/my-pkg"
(which would match the name
attribute in package.json
).
Note: This is in a pure javascript project where I'm attempting to generate types.
/* Generated with tsc --init via TypeScript 3.7.0-beta */
{
"compilerOptions": {
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"allowJs": true, /* Allow javascript files to be compiled. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
"outFile": "./lib/index.js", /* Concatenate and emit output to single file. */
"emitDeclarationOnly": true, /* Only emit .d.ts files. */
"strict": true, /* Enable all strict type-checking options. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"include": [
"js/**/*"
]
}