Avoid infinite rebuilds

This commit is contained in:
Jake Archibald
2020-09-22 17:48:51 +01:00
parent d2807ebb18
commit a30e38856e

View File

@@ -19,6 +19,8 @@ import glob from 'glob';
const globP = promisify(glob);
export default function () {
let previousWorkerContent;
return {
name: 'image-worker-plugin',
async buildStart() {
@@ -56,6 +58,10 @@ export default function () {
.flat(Infinity)
.join('\n');
// If nothing's changed, avoid touching the file to avoid infinite rebuilding in watch mode
if (previousWorkerContent === workerFile) return;
previousWorkerContent = workerFile;
const tsConfig = {
extends: '../../../generic-tsconfig.json',
compilerOptions: {