TypeStrong / fork-ts-checker-webpack-plugin

Webpack plugin that runs typescript type checker on a separate process.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUILTIN_IGNORED_DIRS hampering recompilation

pacop opened this issue · comments

commented

Current behavior

.d.ts files from node_modules are not triggering recompilation after hot change (Use case: yarn link/yalc link)

After debugging I've found that after changing some file at node_modules/whatever/file.d.ts, webpack detects my change, but fork-ts-checker-webpack-plugin ignores the change.

https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/main/src/watch/inclusive-node-watch-file-system.ts#L14
This default configuration is making that this line is printed.

Expected behavior

From my point of view BUILTIN_IGNORED_DIRS should be extracted as parameter, even when the package provide the default values, we should enable user to change in whatever way they want.

Steps to reproduce the issue

  1. Download example: https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/tree/main/examples/babel-loader
  2. Run yarn install
  3. Create the following files:
    node_modules/fake/package.json
{
  name: "fake",
  version: "0.1.0"
}

node_modules/fake/a.js

export const a = 1

node_modules/fake/a.d.ts

declare module "fake/a" {
  export const a: number
}

index.ts:

import {a} from "fake/a"
  1. run yarn dev
  2. Change node_modules/fake/a.d.ts to:
declare module "fake/a" {
  export const not: number
}

Types should be marked as broken but is not.

Issue reproduction repository

Environment

  • fork-ts-checker-webpack-plugin: 7.2.11
  • typescript: ^4.6.4
  • eslint: -
  • webpack: ^5.72.0
  • os: Ubuntu 19.04

🎉 This issue has been resolved in version 7.2.12 🎉

The release is available on:

Your semantic-release bot 📦🚀