Skip to content

Commit

Permalink
fix type checking for rebuilds on global *.d.ts changes
Browse files Browse the repository at this point in the history
  • Loading branch information
schlawg committed Jun 21, 2024
1 parent 5679f1a commit a2fbc2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ui/.build/src/clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const globOpts: fg.Options = {
markDirectories: true,
};

const globs = [
const allGlobs = [
'**/node_modules',
'**/css/**/gen',
'ui/.build/dist/css',
Expand All @@ -20,7 +20,7 @@ const globs = [
'public/css',
];

export async function clean() {
export async function clean(globs: string[] = allGlobs) {
if (!env.clean) return;

for (const glob of globs) {
Expand Down
5 changes: 4 additions & 1 deletion ui/.build/src/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as ps from 'node:process';
import { build, stop } from './build';
import { env } from './main';
import { globArray } from './parse';
import { clean } from './clean';
import { stopTsc, tsc } from './tsc';
import { stopEsbuild, esbuild } from './esbuild';

Expand All @@ -30,7 +31,9 @@ export async function startMonitor(mods: string[]) {
stopEsbuild();
clearTimeout(tscTimeout);
tscTimeout = setTimeout(() => {
if (!reinitTimeout) esbuild(tsc());
if (reinitTimeout) return;
clean(['ui/*/tsconfig.tsbuildinfo']);
esbuild(tsc());
}, 2000);
};
const packageChange = async () => {
Expand Down

0 comments on commit a2fbc2f

Please sign in to comment.