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

Commit ebe24d9

Browse files
committed
feat(*): resolve tsconfig with different name
1 parent 0de9638 commit ebe24d9

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"ps-node": "0.0.5",
6565
"rimraf": "^2.5.0",
6666
"tslint": "3.5.0-dev.1",
67-
"typescript": "^1.9.0-dev.20160303",
67+
"typescript": "^1.9.0-dev.20160319",
6868
"webpack": "^1.12.12",
6969
"webpack-dev-server": "^1.14.1"
7070
}

src/deps.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ export class FileAnalyzer {
163163
});
164164

165165
let resolvedImports = await Promise.all(task);
166-
return resolvedImports.filter(Boolean);
166+
167+
// FIXME ts bug
168+
return resolvedImports.filter(Boolean) as any;
167169
}
168170

169171
resolve(resolver: IResolver, fileName: string, defPath: string): Promise<string> {

src/instance.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,12 @@ export function ensureInstance(webpack: IWebPack, options: ICompilerOptions, ins
150150

151151
let configFilePath: string;
152152
let configFile: tsconfig.TSConfig;
153-
let folder = options.tsconfig || process.cwd();
154-
configFilePath = tsconfig.resolveSync(folder);
153+
if (options.tsconfig && options.tsconfig.match(/\.json$/)) {
154+
configFilePath = options.tsconfig;
155+
} else {
156+
configFilePath = tsconfig.resolveSync(options.tsconfig || process.cwd());
157+
}
158+
155159
if (configFilePath) {
156160
let content = fs.readFileSync(configFilePath).toString();
157161
configFile = parseContent(content, configFilePath);

src/test/salsa.ts

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ describe('salsa test', function() {
1414
let exclude = [ /exclude/ ];
1515

1616
let stats = await cleanAndCompile(createConfig(config, { loaderParams, exclude }));
17+
18+
console.log(stats.compilation.errors);
19+
1720
expect(stats.compilation.errors.length).eq(2);
1821
expect(stats.compilation.errors[0].toString()).include('Cannot find module');
1922
expect(stats.compilation.errors[1].toString()).include(`Argument of type 'string'`);

0 commit comments

Comments
 (0)