Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// This watcher needs a newer version of libc6
parcelWatcher = require('@parcel/watcher');
await parcelWatcher.writeSnapshot(STATIC, snapshotPath);
}
minorStaticFiles = staticFiles.filter((path) => !['css', 'js'].includes(path));
} else {
if (['add', 'change'].includes(event)) {
minorStaticFiles = [path.replace(`${STATIC}/`, '')];
} else if (event === 'unlink') {
fs.remove(`${BUILD}/${path}`);
}
let parcelWatcher = require('@parcel/watcher');
await parcelWatcher.writeSnapshot(STATIC, snapshotPath);
}
let copyPromises = [];
for (const asset of minorStaticFiles) {
copyPromises.push(
fs.copy(
`${STATIC}/${asset}`,
`${BUILD}/${STATIC}/${asset}`
)
);
}
await Promise.all(copyPromises);
logger.timeEnd(message);
} catch (error) {
throw error;
async writeSnapshot(
dir: FilePath,
snapshot: FilePath,
opts: WatcherOptions,
): Promise {
await watcher.writeSnapshot(dir, snapshot, opts);
}