diff --git a/packages/cubejs-backend-shared/src/env.ts b/packages/cubejs-backend-shared/src/env.ts index 85480accd48bc..192c9da7b9abe 100644 --- a/packages/cubejs-backend-shared/src/env.ts +++ b/packages/cubejs-backend-shared/src/env.ts @@ -1785,6 +1785,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 11d7d51a0fd89..bc764186a98d6 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 bbc1883bcbb82..57b6e0954669b 100644 --- a/packages/cubejs-server-core/src/core/server.ts +++ b/packages/cubejs-server-core/src/core/server.ts @@ -689,6 +689,7 @@ export class CubejsServerCore { sqlCache: this.options.sqlCache, standalone: this.standalone, allowNodeRequire: options.allowNodeRequire, + fastReloadEnabled: options.fastReloadEnabled || getEnv('fastReloadEnabled'), }, ); }