diff --git a/packages/packem/packem.config.ts b/packages/packem/packem.config.ts index 2164cd58a..6979a4ae4 100644 --- a/packages/packem/packem.config.ts +++ b/packages/packem/packem.config.ts @@ -5,7 +5,7 @@ import isolatedDeclarationTransformer from "./src/rollup/plugins/typescript/isol // eslint-disable-next-line import/no-unused-modules export default defineConfig({ cjsInterop: true, - fileCache: false, + fileCache: true, isolatedDeclarationTransformer, rollup: { license: { diff --git a/packages/packem/src/rollup/build.ts b/packages/packem/src/rollup/build.ts index 989c1203c..461c07fa7 100644 --- a/packages/packem/src/rollup/build.ts +++ b/packages/packem/src/rollup/build.ts @@ -17,7 +17,9 @@ const build = async (context: BuildContext, fileCache: FileCache, subDirectory: return; } - rollupOptions.cache = fileCache.get(BUNDLE_CACHE_KEY, subDirectory); + if (!context.options.rollup.isolatedDeclarations || !context.options.isolatedDeclarationTransformer) { + rollupOptions.cache = fileCache.get(BUNDLE_CACHE_KEY, subDirectory); + } const buildResult = await rollup(rollupOptions); diff --git a/packages/packem/src/rollup/watch.ts b/packages/packem/src/rollup/watch.ts index 97a4a368e..aba131d74 100644 --- a/packages/packem/src/rollup/watch.ts +++ b/packages/packem/src/rollup/watch.ts @@ -84,7 +84,9 @@ const watch = async (context: BuildContext, fileCache: FileCache): Promise return; } - rollupOptions.cache = fileCache.get(WATCH_CACHE_KEY); + if (!context.options.rollup.isolatedDeclarations || !context.options.isolatedDeclarationTransformer) { + rollupOptions.cache = fileCache.get(WATCH_CACHE_KEY); + } if (context.options.rollup.watch && typeof rollupOptions.watch === "object" && rollupOptions.watch.include === undefined) { rollupOptions.watch = { diff --git a/packages/packem/tsconfig.json b/packages/packem/tsconfig.json index b364647ea..2504a5671 100644 --- a/packages/packem/tsconfig.json +++ b/packages/packem/tsconfig.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/tsconfig", "extends": "../../tsconfig.base.json", - "include": ["src/**/*", "*.d.ts"], + "include": ["src/**/*", "*.d.ts", "./packem.config.ts"], "compilerOptions": { "moduleResolution": "Bundler" } diff --git a/tsconfig.base.json b/tsconfig.base.json index 15486c13f..21015f723 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -50,9 +50,9 @@ "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "allowJs": false, - "checkJs": false, - "isolatedDeclarations": true, + "allowJs": true, + "checkJs": true, + "isolatedDeclarations": false, "noErrorTruncation": true }, "exclude": ["dist/**/*", "node_modules/**/*", "build/**/*", "scripts/**/*", "examples/**", "**/coverage/**"]