From f1da577ba325bc995d1ef4b4b1223abfa7b78877 Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Thu, 12 Nov 2020 12:28:34 +0000 Subject: [PATCH] Avoid double builds --- rollup.config.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 94e2f311..47d060ee 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -93,8 +93,15 @@ export default async function ({ watch }) { assetFileNames: staticPath, exports: 'named', }, - // Don't watch the ts files. Instead we watch the output from the ts compiler. - watch: { clearScreen: false, exclude: ['**/*.ts', '**/*.tsx'] }, + watch: { + clearScreen: false, + // Don't watch the ts files. Instead we watch the output from the ts compiler. + exclude: ['**/*.ts', '**/*.tsx'], + // Sometimes TypeScript does its thing a little slowly, which causes + // Rollup to build twice on each change. This delay seems to fix it, + // although we may need to change this number over time. + buildDelay: 250, + }, preserveModules: true, plugins: [ { resolveFileUrl, resolveImportMeta },