Skip to content

BUILTIN_IGNORED_DIRS hampering recompilation #752

@pacop

Description

@pacop

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions