diff --git a/packages/cubejs-backend-shared/src/env.ts b/packages/cubejs-backend-shared/src/env.ts index f6df8bd4bf933..1d32930c71ee1 100644 --- a/packages/cubejs-backend-shared/src/env.ts +++ b/packages/cubejs-backend-shared/src/env.ts @@ -1963,6 +1963,9 @@ const variables: Record any> = { return undefined; }, + fastReloadEnabled: () => get('CUBEJS_FAST_RELOAD_ENABLED') + .default('false') + .asBoolStrict(), }; type Vars = typeof variables; diff --git a/packages/cubejs-server-core/src/core/CompilerApi.js b/packages/cubejs-server-core/src/core/CompilerApi.js index 6114cfc906ada..04eabdfed21b4 100644 --- a/packages/cubejs-server-core/src/core/CompilerApi.js +++ b/packages/cubejs-server-core/src/core/CompilerApi.js @@ -53,7 +53,7 @@ export class CompilerApi { compilerVersion = JSON.stringify(compilerVersion); } - if (this.options.devServer) { + if (this.options.devServer || this.options.fastReloadEnabled) { const files = await this.repository.dataSchemaFiles(); compilerVersion += `_${crypto.createHash('md5').update(JSON.stringify(files)).digest('hex')}`; } diff --git a/packages/cubejs-server-core/src/core/server.ts b/packages/cubejs-server-core/src/core/server.ts index ff576c175fcb4..5f44f0adf9482 100644 --- a/packages/cubejs-server-core/src/core/server.ts +++ b/packages/cubejs-server-core/src/core/server.ts @@ -712,6 +712,7 @@ export class CubejsServerCore { sqlCache: this.options.sqlCache, standalone: this.standalone, allowNodeRequire: options.allowNodeRequire, + fastReloadEnabled: options.fastReloadEnabled || getEnv('fastReloadEnabled'), }, ); }