File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @callstack/repack " : patch
3+ ---
4+
5+ Hide persistent cache behind ` REPACK_EXPERIMENTAL_CACHE ` flag
Original file line number Diff line number Diff line change 1+ import { EXPERIMENTAL_CACHE_ENV_KEY } from '../../../env.js' ;
12import { DEFAULT_HOSTNAME , DEFAULT_PORT } from '../../consts.js' ;
23
4+ function isExperimentalCacheEnabled ( ) {
5+ return (
6+ process . env [ EXPERIMENTAL_CACHE_ENV_KEY ] === 'true' ||
7+ process . env [ EXPERIMENTAL_CACHE_ENV_KEY ] === '1'
8+ ) ;
9+ }
10+
311function getCacheConfig ( bundler : 'rspack' | 'webpack' ) {
4- if ( bundler === 'rspack' ) {
5- return {
6- cache : true ,
7- experiments : { cache : { type : 'persistent' } } ,
8- } ;
12+ if ( isExperimentalCacheEnabled ( ) ) {
13+ if ( bundler === 'rspack' ) {
14+ return {
15+ cache : true ,
16+ experiments : { cache : { type : 'persistent' } } ,
17+ } ;
18+ }
19+ return { cache : { type : 'filesystem' } } ;
920 }
10-
11- return { cache : { type : 'filesystem' } } ;
21+ return { } ;
1222}
1323
1424function getStartCommandDefaults ( bundler : 'rspack' | 'webpack' ) {
Original file line number Diff line number Diff line change @@ -4,3 +4,5 @@ export const WORKER_ENV_KEY = 'REPACK_WORKER';
44export const BUNDLE_FILENAME_ENV_KEY = 'REPACK_BUNDLE_FILENAME' ;
55export const SOURCEMAP_FILENAME_ENV_KEY = 'REPACK_SOURCEMAP_FILENAME' ;
66export const ASSETS_DEST_ENV_KEY = 'REPACK_ASSETS_DEST' ;
7+
8+ export const EXPERIMENTAL_CACHE_ENV_KEY = 'REPACK_EXPERIMENTAL_CACHE' ;
You can’t perform that action at this time.
0 commit comments