Skip to content

Commit e461b5c

Browse files
committed
some improvement in transpile js native
1 parent 688174c commit e461b5c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/cubejs-schema-compiler/src/compiler/DataSchemaCompiler.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -280,21 +280,18 @@ export class DataSchemaCompiler {
280280
}
281281

282282
if (transpilationNative) {
283-
// Warming up swc compiler cache
284-
const dummyFile = {
285-
fileName: 'dummy.js',
286-
content: ';',
287-
};
288-
289-
await this.transpileJsFile(dummyFile, errorsReport, { cubeNames, cubeSymbols, transpilerNames, contextSymbols: CONTEXT_SYMBOLS, compilerId, stage });
290-
291-
const nonJsFilesTasks = toCompile.filter(file => !file.fileName.endsWith('.js') && !file.convertedToJs)
292-
.map(f => this.transpileFile(f, errorsReport, { cubeNames, cubeSymbols, transpilerNames, compilerId }));
293-
294283
const jsFiles = toCompile.filter(file => file.fileName.endsWith('.js') || file.convertedToJs);
295284
let JsFilesTasks = [];
296285

297286
if (jsFiles.length > 0) {
287+
// Warming up swc compiler cache
288+
const dummyFile = {
289+
fileName: 'dummy.js',
290+
content: ';',
291+
};
292+
293+
await this.transpileJsFile(dummyFile, errorsReport, { cubeNames, cubeSymbols, transpilerNames, contextSymbols: CONTEXT_SYMBOLS, compilerId, stage });
294+
298295
let jsChunks;
299296
if (jsFiles.length < transpilationNativeThreadsCount * transpilationNativeThreadsCount) {
300297
jsChunks = [jsFiles];
@@ -311,6 +308,9 @@ export class DataSchemaCompiler {
311308
JsFilesTasks = jsChunks.map(chunk => this.transpileJsFilesBulk(chunk, errorsReport, { transpilerNames, compilerId }));
312309
}
313310

311+
const nonJsFilesTasks = toCompile.filter(file => !file.fileName.endsWith('.js') && !file.convertedToJs)
312+
.map(f => this.transpileFile(f, errorsReport, { cubeNames, cubeSymbols, transpilerNames, compilerId }));
313+
314314
results = (await Promise.all([...nonJsFilesTasks, ...JsFilesTasks])).flat();
315315
} else if (transpilationWorkerThreads) {
316316
results = await Promise.all(toCompile.map(f => this.transpileFile(f, errorsReport, { cubeNames, cubeSymbols, transpilerNames })));

0 commit comments

Comments
 (0)