Skip to content

Commit 17a88de

Browse files
committed
filter out files we don't transpile/compile
1 parent 0d7f9ee commit 17a88de

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,13 @@ export class DataSchemaCompiler {
219219

220220
// As we mutate files data, we need a copy, not a refs.
221221
// FileContent is a plain object with primitives, so it's enough for a shallow copy.
222-
let toCompile = this.filesToCompile?.length
223-
? files.filter(f => this.filesToCompile.includes(f.fileName)).map(f => ({ ...f }))
224-
: files.map(f => ({ ...f }));
222+
let toCompile = (this.filesToCompile?.length
223+
? files.filter(f => this.filesToCompile.includes(f.fileName))
224+
: files).filter(f => f.fileName.endsWith('.js')
225+
// We don't transpile/compile other files (like .py and so on)
226+
|| f.fileName.endsWith('.yml')
227+
|| f.fileName.endsWith('.yaml')
228+
|| f.fileName.endsWith('.jinja')).map(f => ({ ...f }));
225229

226230
const jinjaTemplatedFiles = toCompile.filter((file) => file.fileName.endsWith('.jinja') ||
227231
(file.fileName.endsWith('.yml') || file.fileName.endsWith('.yaml')) && file.content.match(JINJA_SYNTAX));

0 commit comments

Comments
 (0)