Skip to content

Commit

Permalink
feat: allow customising generated tsconfig path (#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Mar 6, 2023
1 parent a5c5a48 commit 6260f9a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export async function writeTypes(nitro: Nitro) {
],
};
await writeFile(
join(nitro.options.buildDir, "types/tsconfig.json"),
resolve(nitro.options.buildDir, nitro.options.typescript.tsconfigPath),
JSON.stringify(tsConfig, null, 2)
);
}
Expand Down
1 change: 1 addition & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const NitroDefaults: NitroConfig = {
// Advanced
typescript: {
generateTsConfig: true,
tsconfigPath: "types/tsconfig.json",
internalPaths: false,
},
nodeModulesDirs: [],
Expand Down
2 changes: 2 additions & 0 deletions src/types/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ export interface NitroOptions extends PresetOptions {
typescript: {
internalPaths?: boolean;
generateTsConfig?: boolean;
/** the path of the generated `tsconfig.json`, relative to buildDir */
tsconfigPath: string;
};
hooks: NestedHooks<NitroHooks>;
nodeModulesDirs: string[];
Expand Down

0 comments on commit 6260f9a

Please sign in to comment.