Skip to content

Commit a196d87

Browse files
committed
feat(index): add 'extraCacheKeys' option
1 parent ee5e649 commit a196d87

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
8686
{
8787
check: true,
8888
verbosity: VerbosityLevel.Warning,
89-
clean: true,
89+
clean: !options?.extraCacheKeys && (options?.sourceMapCallback || options?.transformers),
9090
cacheRoot: findCacheDir({ name: "rollup-plugin-typescript2" }),
9191
include: ["*.ts+(|x)", "**/*.ts+(|x)"],
9292
exclude: ["*.d.ts", "**/*.d.ts"],
@@ -99,6 +99,7 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
9999
tsconfigDefaults: {},
100100
objectHashIgnoreUnknownHack: false,
101101
cwd: process.cwd(),
102+
extraCacheKeys: []
102103
}, options as IOptions);
103104

104105
if (!pluginOptions.typescript) {

src/ioptions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ export interface IOptions
3030
tsconfigDefaults: any;
3131
sourceMapCallback: (id: string, map: string) => void;
3232
objectHashIgnoreUnknownHack: boolean;
33+
extraCacheKeys: string[]
3334
}

0 commit comments

Comments
 (0)