From a196d87d91677ece11274b8fff0f592862cbbe6f Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Sun, 18 Sep 2022 18:33:47 +0200 Subject: [PATCH] feat(index): add 'extraCacheKeys' option --- src/index.ts | 3 ++- src/ioptions.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index d6a35bcf..8b0ba073 100644 --- a/src/index.ts +++ b/src/index.ts @@ -86,7 +86,7 @@ const typescript: PluginImpl = (options) => { check: true, verbosity: VerbosityLevel.Warning, - clean: true, + clean: !options?.extraCacheKeys && (options?.sourceMapCallback || options?.transformers), cacheRoot: findCacheDir({ name: "rollup-plugin-typescript2" }), include: ["*.ts+(|x)", "**/*.ts+(|x)"], exclude: ["*.d.ts", "**/*.d.ts"], @@ -99,6 +99,7 @@ const typescript: PluginImpl = (options) => tsconfigDefaults: {}, objectHashIgnoreUnknownHack: false, cwd: process.cwd(), + extraCacheKeys: [] }, options as IOptions); if (!pluginOptions.typescript) { diff --git a/src/ioptions.ts b/src/ioptions.ts index 1f7ad458..d4ba98d1 100644 --- a/src/ioptions.ts +++ b/src/ioptions.ts @@ -30,4 +30,5 @@ export interface IOptions tsconfigDefaults: any; sourceMapCallback: (id: string, map: string) => void; objectHashIgnoreUnknownHack: boolean; + extraCacheKeys: string[] }