(packageName: string, ...paths: string[])
| 43 | ]; |
| 44 | |
| 45 | function updateTsConfig(packageName: string, ...paths: string[]) { |
| 46 | return (host: Tree) => { |
| 47 | if (!host.exists('tsconfig.json')) { |
| 48 | return host; |
| 49 | } |
| 50 | |
| 51 | const file = new JSONFile(host, 'tsconfig.json'); |
| 52 | const jsonPath = ['compilerOptions', 'paths', packageName]; |
| 53 | const value = file.get(jsonPath); |
| 54 | file.modify(jsonPath, Array.isArray(value) ? [...value, ...paths] : paths); |
| 55 | }; |
| 56 | } |
| 57 | |
| 58 | function addTsProjectReference(...paths: string[]) { |
| 59 | return (host: Tree) => { |