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

Commit

Permalink
fix(*): patch resolver for webpack2
Browse files Browse the repository at this point in the history
  • Loading branch information
s-panferov committed Mar 30, 2016
1 parent dd9fb36 commit 60ca777
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ export function createResolver(
exclude: Exclude,
webpackResolver: any
): IResolver {
let resolver: IResolver = promisify(webpackResolver) as any;
let finalResolver = webpackResolver;
if (webpackResolver.length === 4) {
// patch resolver for webpack2
finalResolver = (path, request, callback) => webpackResolver({}, path, request, callback);
}
let resolver: IResolver = promisify(finalResolver) as any;

function resolve(base: string, dep: string): Promise<string> {
let inWebpackExternals = externals && externals.hasOwnProperty(dep);
Expand Down
2 changes: 0 additions & 2 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
"./test/fixtures/errors/with-type-errors.ts",
"./test/fixtures/salsa/index.ts",
"./test/index.ts",
"./test/output/src/test/fixtures/declaration/basic.d.ts",
"./test/output/src/test/fixtures/declaration/iface.d.ts",
"./test/salsa.ts",
"./test/utils.ts",
"./tsconfig-utils.ts"
Expand Down

0 comments on commit 60ca777

Please sign in to comment.