Skip to content

Commit 3aebb1e

Browse files
authored
Exclude tmp, storage, and build directories from file watcher (#91)
1 parent ea21b52 commit 3aebb1e

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

src/file_system.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { memoize } from './utils.ts'
1717
import { type InspectedFile, type AssemblerRcFile } from './types/common.ts'
1818

1919
const DEFAULT_INCLUDES = ['**/*']
20-
const ALWAYS_EXCLUDE = ['.git/**', 'coverage/**', '.github/**', '.adonisjs/**']
20+
const ALWAYS_EXCLUDE = ['.git/**', 'coverage/**', '.github/**', '.adonisjs/**', 'tmp/**', 'storage/**', 'build/**']
2121
const DEFAULT_EXCLUDES = ['node_modules/**', 'bower_components/**', 'jspm_packages/**']
2222

2323
/**
@@ -111,7 +111,7 @@ export class FileSystem {
111111
*
112112
* Following patterns are always ignored
113113
*
114-
* '.git/**', 'coverage/**', '.github/**'
114+
* '.git/**', 'coverage/**', '.github/**', '.adonisjs/**', 'tmp/**', 'storage/**', 'build/**'
115115
*/
116116
get excludes(): string[] {
117117
return this.#excludes

tests/file_system.spec.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,30 @@ test.group('File system', () => {
142142
input: '.git',
143143
result: false,
144144
},
145+
{
146+
input: 'tmp',
147+
result: false,
148+
},
149+
{
150+
input: 'tmp/foo',
151+
result: false,
152+
},
153+
{
154+
input: 'storage',
155+
result: false,
156+
},
157+
{
158+
input: 'storage/logs',
159+
result: false,
160+
},
161+
{
162+
input: 'build',
163+
result: false,
164+
},
165+
{
166+
input: 'build/app',
167+
result: false,
168+
},
145169
])
146170
.run(({ assert }, { input, result }) => {
147171
const config = readTsConfig(BASE_PATH)!

0 commit comments

Comments
 (0)