Skip to content

Commit

Permalink
Merge pull request #16 from defunty/master-add_option_variable_of_fs_…
Browse files Browse the repository at this point in the history
…watch_for_linux

fix: add variable for linux
  • Loading branch information
nolimits4web committed Jan 10, 2022
2 parents 3712c19 + f0f9c38 commit a7c7197
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ const watchFunction = async (fileName) => {
console.log('something wrong...');
};

const recursive = !(
process.platform === 'linux' && parseInt(process.versions.node.split('.')[0], 10) >= 14
);
let watchTimeout;
fs.watch(path.resolve(__dirname, '../src'), { recursive: true }, (eventType, fileName) => {
fs.watch(path.resolve(__dirname, '../src'), { recursive }, (eventType, fileName) => {
clearTimeout(watchTimeout);
watchTimeout = setTimeout(() => {
watchFunction(fileName);
Expand Down

0 comments on commit a7c7197

Please sign in to comment.