INNER CODE UNIT · TypeScript

updateTSConfig

StellateHQ/fuse · packages/create-fuse-app/src/index.ts:250

const updateTSConfig = async (targetDir: string, hasSrcDir: boolean) => {
  if (existsSync(resolve(targetDir, 'tsconfig.json'))) {
    const tsConfigFile = await fs.readFile(
      resolve(targetDir, 'tsconfig.json'),
      'utf-8',
    )
    const tsConfig = parse(tsConfigFile) as TsConfigJson
    if (
      !tsConfig.compilerOptions?.plugins?.find(
        (plugin) => plugin.name === '@0no-co/graphqlsp',
      )
    ) {
      const updatedTsConfig = {
        ...tsConfig,
        include: [
          ...(tsConfig.include || []),
          hasSrcDir ? './src/fuse/introspection.ts' : './fuse/introspection.ts',
        ],

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…