Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 8929265

Browse files
committed
fix(build): scan deeplink dir too if different from srcDir
1 parent 00cf038 commit 8929265

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/build/util.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
import { join } from 'path';
2+
3+
import * as Constants from '../util/constants';
24
import { GlobResult, globAll } from '../util/glob-util';
3-
import { readFileAsync } from '../util/helpers';
5+
import { getStringPropertyValue, readFileAsync } from '../util/helpers';
46
import { BuildContext } from '../util/interfaces';
57

68
export function scanSrcTsFiles(context: BuildContext) {
7-
const tsFileGlob = join(context.srcDir, '**', '*.ts');
8-
return globAll([tsFileGlob]).then((results: GlobResult[]) => {
9+
const srcGlob = join(context.srcDir, '**', '*.ts');
10+
const globs: string[] = [srcGlob];
11+
const deepLinkDir = getStringPropertyValue(Constants.ENV_VAR_DEEPLINKS_DIR);
12+
// these two will only not be equal in some weird cases like for building Ionic's demos with our current repository set-up
13+
if (deepLinkDir !== context.srcDir) {
14+
globs.push(join(deepLinkDir, '**', '*.ts'));
15+
}
16+
return globAll(globs).then((results: GlobResult[]) => {
917
const promises = results.map(result => {
1018
const promise = readFileAsync(result.absolutePath);
1119
promise.then((fileContent: string) => {

0 commit comments

Comments
 (0)