-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This plugin shows the files which triggered the change
- Loading branch information
Florian Weber
committed
Apr 25, 2019
1 parent
9779759
commit 8b8dc98
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import path from 'path'; | ||
import chalk from 'chalk'; | ||
import logSymbols from 'log-symbols'; | ||
|
||
export default class FilesChanged { | ||
apply(compiler) { | ||
compiler.hooks.watchRun.tap('averjs', compiler => { | ||
const { watchFileSystem } = compiler; | ||
const watcher = watchFileSystem.watcher || watchFileSystem.wfs.watcher; | ||
|
||
let changedFiles = ''; | ||
for (const file of Object.keys(watcher.mtimes)) { | ||
changedFiles += ` ${chalk.bold.blue(path.basename(file))},`; | ||
} | ||
|
||
console.log( | ||
logSymbols.info, | ||
`Files changed:${changedFiles.slice(0, -1)}` | ||
); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters