babel-plugin-tsconfig-paths-module-resolver
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -23,6 +23,2 @@ "use strict"; | ||
opts.resolvePath = opts.resolvePath || (0, _createResolvePath.createResolvePath)(); | ||
if (!opts._originalResolvePath && opts.resolvePath) { | ||
opts._originalResolvePath = opts.resolvePath; | ||
} | ||
} | ||
@@ -29,0 +25,0 @@ |
@@ -21,6 +21,8 @@ "use strict"; | ||
const matchPath = configLoaderResult.resultType === 'success' && (0, _tsconfigPaths.createMatchPath)(configLoaderResult.absoluteBaseUrl, configLoaderResult.paths); | ||
return function resolvePath(...args) { | ||
const [sourcePath, currentFile, opts] = args; | ||
const fallbackResolvePath = opts._originalResolvePath || _babelPluginModuleResolver.resolvePath; | ||
return function resolvePath(sourcePath, currentFile, opts) { | ||
const fallbackResolvePath = opts._fromNested ? _babelPluginModuleResolver.resolvePath : opts.resolvePath || _babelPluginModuleResolver.resolvePath; | ||
const extensions = opts.extensions || _defaultExtensions.defaultExtensions; | ||
const nextOpts = { ...opts, | ||
_fromNested: true | ||
}; | ||
@@ -32,3 +34,3 @@ if (!matchPath) { | ||
return fallbackResolvePath(...args); | ||
return fallbackResolvePath(sourcePath, currentFile, nextOpts); | ||
} | ||
@@ -44,4 +46,4 @@ | ||
return fallbackResolvePath(...args); | ||
return fallbackResolvePath(sourcePath, currentFile, nextOpts); | ||
}; | ||
} |
@@ -208,6 +208,2 @@ declare module 'babel-plugin-module-resolver' { | ||
logLevel?: string; | ||
/** | ||
* @internal | ||
*/ | ||
_originalResolvePath?: ResolvePath; | ||
} | ||
@@ -214,0 +210,0 @@ |
{ | ||
"name": "babel-plugin-tsconfig-paths-module-resolver", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A babel plugin that combines babel-plugin-module-resolver and tsconfig-paths to resolve tsconfig paths", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
20501
343