Skip to content

Commit

Permalink
cleanup(js): add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
leosvelperez committed Dec 16, 2024
1 parent df7e3b3 commit baa885d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/js/src/generators/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,10 @@ function createFiles(tree: Tree, options: NormalizedLibraryGeneratorOptions) {
tsConfig.options.moduleResolution === ts.ModuleResolutionKind.Node16 ||
tsConfig.options.moduleResolution === ts.ModuleResolutionKind.NodeNext
) {
// Node16 and NodeNext require explicit file extensions for relative
// import paths. Since we generate the file with the `.ts` extension,
// we import it from the same file with the `.js` extension.
// https://www.typescriptlang.org/docs/handbook/modules/reference.html#file-extension-substitution
fileNameImport = `${options.fileName}.js`;
}
}
Expand Down

0 comments on commit baa885d

Please sign in to comment.