Files

Return to Package Diff Home.
Brought to you by Intrinsic.

Package Diff: ts-loader @ 6.0.0 .. 6.0.1

CHANGELOG.md

@@ -1,5 +1,10 @@
# Changelog
+## v6.0.1
+
+* [Fix issue with `resolveTypeReferenceDirective` causing errors like `Cannot find name 'it'` with Jest](https://github.com/TypeStrong/ts-loader/pull/936) (#934) (#919) - thanks @andrewbranch!
+* [Fix TypeScript diagnostics not being printed to console when using project references](https://github.com/TypeStrong/ts-loader/pull/937) (#932) - thanks @andrewbranch!
+
## v6.0.0
* [Drop support for node < 8.6 related to micromatch upgrade to 4](https://github.com/TypeStrong/ts-loader/pull/930); see: https://github.com/TypeStrong/ts-loader/issues/929

dist/after-compile.js

@@ -94,15 +94,17 @@
return filesToCheckForErrors;
}
function provideErrorsToWebpack(filesToCheckForErrors, filesWithErrors, compilation, modules, instance) {
- const { compiler, program, languageService, files, loaderOptions, compilerOptions, otherFiles } = instance;
+ const { compiler, files, loaderOptions, compilerOptions, otherFiles } = instance;
const filePathRegex = compilerOptions.checkJs === true
? constants.dtsTsTsxJsJsxRegex
: constants.dtsTsTsxRegex;
+ // I’m pretty sure this will never be undefined here
+ const program = utils_1.ensureProgram(instance);
for (const filePath of filesToCheckForErrors.keys()) {
if (filePath.match(filePathRegex) === null) {
continue;
}
- const sourceFile = program === undefined ? undefined : program.getSourceFile(filePath);
+ const sourceFile = program && program.getSourceFile(filePath);
// If the source file is undefined, that probably means it’s actually part of an unbuilt project reference,
// which will have already produced a more useful error than the one we would get by proceeding here.
// If it’s undefined and we’re not using project references at all, I guess carry on so the user will
@@ -110,15 +112,14 @@
if (utils_1.isUsingProjectReferences(instance) && sourceFile === undefined) {
continue;
}
- const errors = program === undefined
- ? [
- ...languageService.getSyntacticDiagnostics(filePath),
- ...languageService.getSemanticDiagnostics(filePath)
- ]
- : [
- ...program.getSyntacticDiagnostics(sourceFile),
- ...program.getSemanticDiagnostics(sourceFile)
- ];
+ const errors = [];
+ if (program && sourceFile) {
+ errors.push(...program.getSyntacticDiagnostics(sourceFile), ...program
+ .getSemanticDiagnostics(sourceFile)
+ // Output file has not been built from source file - this message is redundant with
+ // program.getOptionsDiagnostics() separately added in instances.ts
+ .filter(({ code }) => code !== 6305));
+ }
if (errors.length > 0) {
const fileWithError = files.get(filePath) || otherFiles.get(filePath);
filesWithErrors.set(filePath, fileWithError);
@@ -178,3 +179,4 @@
}
}
}
+//# sourceMappingURL=after-compile.js.map
\ No newline at end of file

dist/compilerSetup.js

@@ -55,3 +55,4 @@
return compilerOptions;
}
exports.getCompilerOptions = getCompilerOptions;
+//# sourceMappingURL=compilerSetup.js.map
\ No newline at end of file

dist/config.js

@@ -83,3 +83,4 @@
return configParseResult;
}
exports.getConfigParseResult = getConfigParseResult;
+//# sourceMappingURL=config.js.map
\ No newline at end of file

dist/constants.js

@@ -17,3 +17,4 @@
exports.jsJsxMap = /\.js(x?)\.map$/i;
exports.jsonRegex = /\.json$/i;
exports.nodeModules = /node_modules/i;
+//# sourceMappingURL=constants.js.map
\ No newline at end of file

dist/index.js

@@ -307,3 +307,4 @@
};
}
module.exports = loader;
+//# sourceMappingURL=index.js.map
\ No newline at end of file

dist/instances.js

@@ -197,3 +197,4 @@
}
}
exports.getEmitOutput = getEmitOutput;
+//# sourceMappingURL=instances.js.map
\ No newline at end of file

dist/interfaces.js

@@ -1,2 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=interfaces.js.map
\ No newline at end of file

dist/logger.js

@@ -35,3 +35,4 @@
};
}
exports.makeLogger = makeLogger;
+//# sourceMappingURL=logger.js.map
\ No newline at end of file

dist/resolver.js

@@ -6,3 +6,4 @@
return node.create.sync(options.resolve);
}
exports.makeResolver = makeResolver;
+//# sourceMappingURL=resolver.js.map
\ No newline at end of file

dist/servicesHost.js

@@ -23,7 +23,9 @@
fileExists,
readFile: readFileWithFallback,
realpath: compiler.sys.realpath,
- directoryExists: compiler.sys.directoryExists
+ directoryExists: compiler.sys.directoryExists,
+ getCurrentDirectory: compiler.sys.getCurrentDirectory,
+ getDirectories: compiler.sys.getDirectories
};
const clearCache = enableFileCaching ? addCache(moduleResolutionHost) : null;
// loader.context seems to work fine on Linux / Mac regardless causes problems for @types resolution on Windows for TypeScript < 2.3
@@ -84,8 +86,7 @@
exports.makeServicesHost = makeServicesHost;
function makeResolvers(compiler, compilerOptions, moduleResolutionHost, customResolveTypeReferenceDirective, customResolveModuleName, resolveSync, appendTsTsxSuffixesIfRequired, scriptRegex, instance) {
const resolveTypeReferenceDirective = makeResolveTypeReferenceDirective(compiler, compilerOptions, moduleResolutionHost, customResolveTypeReferenceDirective);
- const resolveTypeReferenceDirectives = (typeDirectiveNames, containingFile, _redirectedReference) => typeDirectiveNames.map(directive => resolveTypeReferenceDirective(directive, containingFile)
- .resolvedTypeReferenceDirective);
+ const resolveTypeReferenceDirectives = (typeDirectiveNames, containingFile, _redirectedReference) => typeDirectiveNames.map(directive => resolveTypeReferenceDirective(directive, containingFile, _redirectedReference).resolvedTypeReferenceDirective);
const resolveModuleName = makeResolveModuleName(compiler, compilerOptions, moduleResolutionHost, customResolveModuleName);
const resolveModuleNames = (moduleNames, containingFile, _reusedNames, _redirectedReference) => {
const resolvedModules = moduleNames.map(moduleName => resolveModule(resolveSync, resolveModuleName, appendTsTsxSuffixesIfRequired, scriptRegex, moduleName, containingFile));
@@ -241,7 +242,7 @@
exports.makeWatchHost = makeWatchHost;
function makeResolveTypeReferenceDirective(compiler, compilerOptions, moduleResolutionHost, customResolveTypeReferenceDirective) {
if (customResolveTypeReferenceDirective === undefined) {
- return (directive, containingFile) => compiler.resolveTypeReferenceDirective(directive, containingFile, compilerOptions, moduleResolutionHost);
+ return (directive, containingFile, redirectedReference) => compiler.resolveTypeReferenceDirective(directive, containingFile, compilerOptions, moduleResolutionHost, redirectedReference);
}
return (directive, containingFile) => customResolveTypeReferenceDirective(directive, containingFile, compilerOptions, moduleResolutionHost, compiler.resolveTypeReferenceDirective);
}
@@ -328,3 +329,4 @@
}
};
}
+//# sourceMappingURL=servicesHost.js.map
\ No newline at end of file

dist/utils.js

@@ -279,3 +279,4 @@
: '.js';
return outputPath.replace(constants.extensionRegex, newExtension);
}
+//# sourceMappingURL=utils.js.map
\ No newline at end of file

dist/watch-run.js

@@ -49,3 +49,4 @@
}
}
}
+//# sourceMappingURL=watch-run.js.map
\ No newline at end of file

package.json

@@ -1,6 +1,6 @@
{
"name": "ts-loader",
- "version": "6.0.0",
+ "version": "6.0.1",
"description": "TypeScript loader for webpack",
"main": "index.js",
"types": "dist/types/index.d.ts",