Skip to content

Commit 0ec853a

Browse files
authored
fix: ignore package json on 6.5.x (#728)
The error in #674 is caused by a change of the package.json file during the build, which triggers some code path that is valid in WatchCompilerHostOfConfigFile but not in WatchCompilerHostOfFilesAndCompilerOptions that this plugin uses (because of the configOverwrite option). This commit ignores the package.json file in watcher as a work-around.
1 parent 61f7cdf commit 0ec853a

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@v1
8-
8+
99
- name: Setup node
1010
uses: actions/setup-node@v1
1111
with:
@@ -40,11 +40,11 @@ jobs:
4040
needs: build
4141
strategy:
4242
matrix:
43-
node: [10, 12] # add 14 when we drop support for webpack 4 as fsevents 1 is not compatible with node 14
43+
node: [12] # add 14 when we drop support for webpack 4 as fsevents 1 is not compatible with node 14
4444
os: [ubuntu-latest, macos-latest, windows-latest]
4545
steps:
4646
- uses: actions/checkout@v1
47-
47+
4848
- name: Setup node
4949
uses: actions/setup-node@v1
5050
with:
@@ -61,7 +61,7 @@ jobs:
6161
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
6262
restore-keys: |
6363
${{ runner.os }}-yarn-
64-
64+
6565
- name: Install dependencies
6666
run: yarn install --frozen-lockfile
6767

@@ -76,7 +76,7 @@ jobs:
7676

7777
- name: Run e2e tests
7878
run: yarn test:e2e
79-
79+
8080
release:
8181
runs-on: ubuntu-latest
8282
env:
@@ -86,7 +86,7 @@ jobs:
8686
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta')
8787
steps:
8888
- uses: actions/checkout@v1
89-
89+
9090
- name: Setup node
9191
uses: actions/setup-node@v1
9292
with:

release.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
branches: [
3+
'+([0-9])?(.{+([0-9]),x}).x',
34
'main',
45
{
56
name: 'alpha',

src/watch/InclusiveNodeWatchFileSystem.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { clearFilesChange, updateFilesChange } from '../reporter';
77
import minimatch from 'minimatch';
88

99
const BUILTIN_IGNORED_DIRS = ['node_modules', '.git', '.yarn', '.pnp'];
10+
// we ignore package.json file because of https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/674
11+
const BUILTIN_IGNORED_FILES = ['package.json'];
1012

1113
function createIsIgnored(
1214
ignored: WatchFileSystemOptions['ignored'] | undefined,
@@ -32,6 +34,9 @@ function createIsIgnored(
3234
ignoredFunctions.push((path: string) =>
3335
BUILTIN_IGNORED_DIRS.some((ignoredDir) => path.includes(`/${ignoredDir}/`))
3436
);
37+
ignoredFunctions.push((path: string) =>
38+
BUILTIN_IGNORED_FILES.some((ignoredFile) => path.endsWith(`/${ignoredFile}`))
39+
);
3540

3641
return function isIgnored(path: string) {
3742
return ignoredFunctions.some((ignoredFunction) => ignoredFunction(path));

0 commit comments

Comments
 (0)