diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-12-19 22:39:43 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-12-19 22:41:49 +0800 |
commit | 5656605355f201e36667cd054d0eed0a3ba0dbfe (patch) | |
tree | 010f312de3cb7b200ec8747acc51ec0efbbb9d6f /packages/sol-compiler | |
parent | 5c4a992b87aa4341fc768eb4865179f2d36abad2 (diff) | |
download | dexon-sol-tools-5656605355f201e36667cd054d0eed0a3ba0dbfe.tar dexon-sol-tools-5656605355f201e36667cd054d0eed0a3ba0dbfe.tar.gz dexon-sol-tools-5656605355f201e36667cd054d0eed0a3ba0dbfe.tar.bz2 dexon-sol-tools-5656605355f201e36667cd054d0eed0a3ba0dbfe.tar.lz dexon-sol-tools-5656605355f201e36667cd054d0eed0a3ba0dbfe.tar.xz dexon-sol-tools-5656605355f201e36667cd054d0eed0a3ba0dbfe.tar.zst dexon-sol-tools-5656605355f201e36667cd054d0eed0a3ba0dbfe.zip |
Describe regexes
Diffstat (limited to 'packages/sol-compiler')
-rw-r--r-- | packages/sol-compiler/src/compiler.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index 793ab4f93..6b77a464d 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -135,7 +135,10 @@ export class Compiler { public async watchAsync(): Promise<void> { console.clear(); // tslint:disable-line:no-console logUtils.logWithTime('Starting compilation in watch mode...'); - const watcher = chokidar.watch('^$', { ignored: /(^|[\/\\])\../ }); + const MATCH_NOTHING_REGEX = '^$'; + const IGNORE_DOT_FILES_REGEX = /(^|[\/\\])\../; + // Initially we watch nothing. We'll add the paths later. + const watcher = chokidar.watch(MATCH_NOTHING_REGEX, { ignored: IGNORE_DOT_FILES_REGEX }); const onFileChangedAsync = async () => { watcher.unwatch('*'); // Stop watching try { |