@rollup/plugin-typescript
Advanced tools
Comparing version 11.1.1 to 11.1.2
@@ -65,3 +65,3 @@ 'use strict'; | ||
*/ | ||
function createModuleResolver(ts, host) { | ||
function createModuleResolver(ts, host, filter) { | ||
const compilerOptions = host.getCompilationSettings(); | ||
@@ -71,4 +71,11 @@ const cache = ts.createModuleResolutionCache(process.cwd(), host.getCanonicalFileName, compilerOptions); | ||
return (moduleName, containingFile, redirectedReference, mode) => { | ||
const resolved = ts.resolveModuleName(moduleName, containingFile, compilerOptions, moduleHost, cache, redirectedReference, mode); | ||
return resolved.resolvedModule; | ||
const { resolvedModule } = ts.resolveModuleName(moduleName, containingFile, compilerOptions, moduleHost, cache, redirectedReference, mode); | ||
/** | ||
* If the module's path contains 'node_modules', ts considers it an external library and refuses to compile it, | ||
* so we have to change the value of `isExternalLibraryImport` to false if it's true | ||
* */ | ||
if ((resolvedModule === null || resolvedModule === void 0 ? void 0 : resolvedModule.isExternalLibraryImport) && filter(resolvedModule === null || resolvedModule === void 0 ? void 0 : resolvedModule.resolvedFileName)) { | ||
resolvedModule.isExternalLibraryImport = false; | ||
} | ||
return resolvedModule; | ||
}; | ||
@@ -765,3 +772,3 @@ } | ||
const formatHost = createFormattingHost(ts, parsedOptions.options); | ||
const resolveModule = createModuleResolver(ts, formatHost); | ||
const resolveModule = createModuleResolver(ts, formatHost, filter); | ||
let program = null; | ||
@@ -768,0 +775,0 @@ return { |
@@ -43,3 +43,3 @@ import * as path from 'path'; | ||
*/ | ||
function createModuleResolver(ts, host) { | ||
function createModuleResolver(ts, host, filter) { | ||
const compilerOptions = host.getCompilationSettings(); | ||
@@ -49,4 +49,11 @@ const cache = ts.createModuleResolutionCache(process.cwd(), host.getCanonicalFileName, compilerOptions); | ||
return (moduleName, containingFile, redirectedReference, mode) => { | ||
const resolved = ts.resolveModuleName(moduleName, containingFile, compilerOptions, moduleHost, cache, redirectedReference, mode); | ||
return resolved.resolvedModule; | ||
const { resolvedModule } = ts.resolveModuleName(moduleName, containingFile, compilerOptions, moduleHost, cache, redirectedReference, mode); | ||
/** | ||
* If the module's path contains 'node_modules', ts considers it an external library and refuses to compile it, | ||
* so we have to change the value of `isExternalLibraryImport` to false if it's true | ||
* */ | ||
if ((resolvedModule === null || resolvedModule === void 0 ? void 0 : resolvedModule.isExternalLibraryImport) && filter(resolvedModule === null || resolvedModule === void 0 ? void 0 : resolvedModule.resolvedFileName)) { | ||
resolvedModule.isExternalLibraryImport = false; | ||
} | ||
return resolvedModule; | ||
}; | ||
@@ -743,3 +750,3 @@ } | ||
const formatHost = createFormattingHost(ts, parsedOptions.options); | ||
const resolveModule = createModuleResolver(ts, formatHost); | ||
const resolveModule = createModuleResolver(ts, formatHost, filter); | ||
let program = null; | ||
@@ -746,0 +753,0 @@ return { |
{ | ||
"name": "@rollup/plugin-typescript", | ||
"version": "11.1.1", | ||
"version": "11.1.2", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93129
1849