mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-11 16:26:20 +00:00
Avoid infinite rebuilds
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user