aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-compiler
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-12-19 22:39:43 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-12-19 22:41:49 +0800
commit5656605355f201e36667cd054d0eed0a3ba0dbfe (patch)
tree010f312de3cb7b200ec8747acc51ec0efbbb9d6f /packages/sol-compiler
parent5c4a992b87aa4341fc768eb4865179f2d36abad2 (diff)
downloaddexon-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.ts5
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 {