Skip to content

Commit

Permalink
fix: add variable for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
defunty committed Jan 5, 2022
1 parent 3712c19 commit f0f9c38
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 f0f9c38

Please sign in to comment.