Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUILTIN_IGNORED_DIRS hampering recompilation #752

Closed
pacop opened this issue Jun 22, 2022 · 1 comment · Fixed by #757
Closed

BUILTIN_IGNORED_DIRS hampering recompilation #752

pacop opened this issue Jun 22, 2022 · 1 comment · Fixed by #757

Comments

@pacop
Copy link

pacop commented Jun 22, 2022

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
@pacop pacop added the bug label Jun 22, 2022
piotr-oles added a commit that referenced this issue Jul 10, 2022
Ignoring node_modules creates more issues than it solves. We use webpack watcher anyway, so ignoring these files or not will not affect watcher performance. User can always add node_modules to ignored dirs manually in webpack config.

Closes: #752
@piotr-oles
Copy link
Collaborator

🎉 This issue has been resolved in version 7.2.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants