Skip to content

Commit

Permalink
Lab #7
Browse files Browse the repository at this point in the history
  • Loading branch information
christianliebel committed Oct 7, 2024
1 parent f95642f commit b1caf67
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/my-plugin/src/generators/utils/get-source-file.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Tree } from '@nx/devkit';
import { createSourceFile, ScriptTarget } from 'typescript';

export function getSourceFile(tree: Tree, filePath: string) {
const moduleSrc = tree.read(filePath, 'utf-8');
return createSourceFile(filePath, moduleSrc, ScriptTarget.Latest, true);
}

0 comments on commit b1caf67

Please sign in to comment.