Lines Matching refs:filePath
82 let filePath: string;
85 filePath = node.moduleSpecifier.getText().replace(/'|"/g, '');
110 filePath = node.moduleReference.expression.text;
118 if (filePath) {
123 let fileResolvePath: string = getFileFullPath(filePath, pagesDir);
131 sourceFile = generateSourceFileAST(fileResolvePath, filePath);
142 export function generateSourceFileAST(fileResolvePath: string, filePath: string): ts.SourceFile {
149 return ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
507 function isModule(filePath: string): boolean {
526 function isPackageJsonEntry(filePath: string): boolean {
527 const packageJsonPath: string = path.join(filePath, projectConfig.packageJson);
539 if (entryExist(filePath, entryTypes)) {
540 packageJsonEntry = path.resolve(filePath, entryTypes);
542 } else if (entryExist(filePath, entryMain)) {
543 packageJsonEntry = path.resolve(filePath, entryMain);
549 function entryExist(filePath: string, entry: string): boolean {
550 return typeof entry === 'string' && fs.existsSync(path.resolve(filePath, entry)) &&
551 fs.statSync(path.resolve(filePath, entry)).isFile();
554 function getModuleFilePath(filePath: string): string {
555 if (filePath && path.extname(filePath) !== EXTNAME_ETS && isModule(filePath)) {
556 filePath += EXTNAME_ETS;
558 return filePath;
561 function getFileResolvePath(fileResolvePath: string, pagesDir: string, filePath: string,
563 const moduleFilePath: string = getModuleFilePath(filePath);
585 if (filePath.indexOf(projectConfig.packageDir) > -1) {
586 fileResolvePath = path.join(curPageDir, filePath);
588 fileResolvePath = path.join(curPageDir, projectConfig.packageDir, filePath);
614 export function getFileFullPath(filePath: string, pagesDir: string): string {
615 if (filePath && path.extname(filePath) !== EXTNAME_ETS && path.extname(filePath) !== EXTNAME_TS &&
616 !isModule(filePath)) {
617 const dirIndexEtsPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_ETS);
618 const dirIndexTsPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_TS);
619 …if (/^(\.|\.\.)\//.test(filePath) && !fs.existsSync(path.resolve(pagesDir, filePath + EXTNAME_ETS)…
621 filePath = dirIndexEtsPath;
622 …} else if (/^(\.|\.\.)\//.test(filePath) && !fs.existsSync(path.resolve(pagesDir, filePath + EXTNA…
624 filePath = dirIndexTsPath;
626 filePath += getExtensionIfUnfullySpecifiedFilepath(path.resolve(pagesDir, filePath));
631 if (/^(\.|\.\.)\//.test(filePath) && filePath.indexOf(projectConfig.packageDir) < 0) {
632 fileResolvePath = path.resolve(pagesDir, filePath);
633 } else if (/^\//.test(filePath) && filePath.indexOf(projectConfig.packageDir) < 0 ||
634 fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {
635 fileResolvePath = filePath;
637 …fileResolvePath = getFileResolvePath(fileResolvePath, pagesDir, filePath, projectConfig.projectPat…