From 0126b68879342f188a886db76a61e79ea2ba56bd Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 13 Sep 2019 14:42:21 -0700 Subject: [PATCH 01/19] Fix simple run to start with --- src/after-compile.ts | 44 +++--- src/index.ts | 118 ++------------- src/instances.ts | 237 ++++++++++++++++++++++++++--- src/interfaces.ts | 37 ++++- src/servicesHost.ts | 346 ++++++++++++++++++++++++++++--------------- src/utils.ts | 148 ------------------ src/watch-run.ts | 22 +-- 7 files changed, 525 insertions(+), 427 deletions(-) diff --git a/src/after-compile.ts b/src/after-compile.ts index 8918d4fd5..2da397030 100644 --- a/src/after-compile.ts +++ b/src/after-compile.ts @@ -11,16 +11,12 @@ import { WebpackError, WebpackModule } from './interfaces'; -import { - collectAllDependants, - ensureProgram, - formatErrors, - isUsingProjectReferences -} from './utils'; +import { collectAllDependants, ensureProgram, formatErrors } from './utils'; export function makeAfterCompile( instance: TSInstance, - configFilePath: string | undefined + configFilePath: string | undefined, + loaderContext: webpack.loader.LoaderContext ) { let getCompilerOptionDiagnostics = true; let checkAllFilesForErrors = true; @@ -65,9 +61,26 @@ export function makeAfterCompile( provideDeclarationFilesToWebpack( filesToCheckForErrors, instance, - compilation + compilation, + loaderContext ); + if (instance.solutionBuilderHost) { + // append errors + const formattedErrors = instance.solutionBuilderHost.diagnostics.map(d => + formatErrors( + [d], + instance.loaderOptions, + instance.colors, + instance.compiler, + { file: d.file ? path.resolve(d.file.fileName) : 'tsconfig.json' }, + compilation.compiler.context + ) + ); + + compilation.errors.push(...formattedErrors); + } + instance.filesWithErrors = filesWithErrors; instance.modifiedFiles = null; instance.projectsMissingSourceMaps = new Set(); @@ -189,21 +202,13 @@ function provideErrorsToWebpack( // I’m pretty sure this will never be undefined here const program = ensureProgram(instance); + // TODO:: handle referenced projects for (const filePath of filesToCheckForErrors.keys()) { if (filePath.match(filePathRegex) === null) { continue; } 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 - // get a useful error about which file was unexpectedly missing. - if (isUsingProjectReferences(instance) && sourceFile === undefined) { - continue; - } - const errors: ts.Diagnostic[] = []; if (program && sourceFile) { errors.push( @@ -262,14 +267,15 @@ function provideErrorsToWebpack( function provideDeclarationFilesToWebpack( filesToCheckForErrors: TSFiles, instance: TSInstance, - compilation: webpack.compilation.Compilation + compilation: webpack.compilation.Compilation, + loaderContext: webpack.loader.LoaderContext ) { for (const filePath of filesToCheckForErrors.keys()) { if (filePath.match(constants.tsTsxRegex) === null) { continue; } - const outputFiles = getEmitOutput(instance, filePath); + const outputFiles = getEmitOutput(instance, filePath, loaderContext); const declarationFiles = outputFiles.filter(outputFile => outputFile.name.match(constants.dtsDtsxOrDtsDtsxMapRegex) ); diff --git a/src/index.ts b/src/index.ts index 8818205b3..3094638aa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,14 +12,7 @@ import { TSFile, TSInstance } from './interfaces'; -import { - appendSuffixesIfMatch, - arrify, - formatErrors, - getAndCacheOutputJSFileName, - getAndCacheProjectReference, - validateSourceMapOncePerProject -} from './utils'; +import { appendSuffixesIfMatch, arrify, formatErrors } from './utils'; const webpackInstances: webpack.Compiler[] = []; const loaderOptionsCache: LoaderOptionsCache = {}; @@ -69,85 +62,20 @@ function successLoader( : rawFilePath; const fileVersion = updateFileInCache(options, filePath, contents, instance); - const referencedProject = getAndCacheProjectReference(filePath, instance); - if (referencedProject !== undefined) { - const [relativeProjectConfigPath, relativeFilePath] = [ - path.relative( - loaderContext.rootContext, - referencedProject.sourceFile.fileName - ), - path.relative(loaderContext.rootContext, filePath) - ]; - if (referencedProject.commandLine.options.outFile !== undefined) { - throw new Error( - `The referenced project at ${relativeProjectConfigPath} is using ` + - `the outFile' option, which is not supported with ts-loader.` - ); - } - - const jsFileName = getAndCacheOutputJSFileName( - filePath, - referencedProject, - instance - ); - - const relativeJSFileName = path.relative( - loaderContext.rootContext, - jsFileName - ); - if (!instance.compiler.sys.fileExists(jsFileName)) { - throw new Error( - `Could not find output JavaScript file for input ` + - `${relativeFilePath} (looked at ${relativeJSFileName}).\n` + - `The input file is part of a project reference located at ` + - `${relativeProjectConfigPath}, so ts-loader is looking for the ` + - 'project’s pre-built output on disk. Try running `tsc --build` ' + - 'to build project references.' - ); - } - - // Since the output JS file is being read from disk instead of using the - // input TS file, we need to tell the loader that the compilation doesn’t - // actually depend on the current file, but depends on the JS file instead. - loaderContext.clearDependencies(); - loaderContext.addDependency(jsFileName); - - validateSourceMapOncePerProject( - instance, - loaderContext, - jsFileName, - referencedProject - ); + const { outputText, sourceMapText } = options.transpileOnly + ? getTranspilationEmit(filePath, contents, instance, loaderContext) + : getEmit(rawFilePath, filePath, instance, loaderContext); - const mapFileName = jsFileName + '.map'; - const outputText = instance.compiler.sys.readFile(jsFileName); - const sourceMapText = instance.compiler.sys.readFile(mapFileName); - makeSourceMapAndFinish( - sourceMapText, - outputText, - filePath, - contents, - loaderContext, - options, - fileVersion, - callback - ); - } else { - const { outputText, sourceMapText } = options.transpileOnly - ? getTranspilationEmit(filePath, contents, instance, loaderContext) - : getEmit(rawFilePath, filePath, instance, loaderContext); - - makeSourceMapAndFinish( - sourceMapText, - outputText, - filePath, - contents, - loaderContext, - options, - fileVersion, - callback - ); - } + makeSourceMapAndFinish( + sourceMapText, + outputText, + filePath, + contents, + loaderContext, + options, + fileVersion, + callback + ); } function makeSourceMapAndFinish( @@ -408,7 +336,7 @@ function getEmit( instance: TSInstance, loaderContext: webpack.loader.LoaderContext ) { - const outputFiles = getEmitOutput(instance, filePath); + const outputFiles = getEmitOutput(instance, filePath, loaderContext); loaderContext.clearDependencies(); loaderContext.addDependency(rawFilePath); @@ -426,21 +354,7 @@ function getEmit( const additionalDependencies = fileDependencies === undefined ? [] - : fileDependencies.map(({ resolvedFileName, originalFileName }) => { - const projectReference = getAndCacheProjectReference( - resolvedFileName, - instance - ); - // In the case of dependencies that are part of a project reference, - // the real dependency that webpack should watch is the JS output file. - return projectReference !== undefined - ? getAndCacheOutputJSFileName( - resolvedFileName, - projectReference, - instance - ) - : originalFileName; - }); + : fileDependencies.map(({ originalFileName }) => originalFileName); if (additionalDependencies.length > 0) { additionalDependencies.forEach(addDependency); diff --git a/src/instances.ts b/src/instances.ts index 97fb57a55..5a45044d1 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -26,7 +26,6 @@ import { appendSuffixesIfMatch, ensureProgram, formatErrors, - isUsingProjectReferences, makeError, supportsSolutionBuild } from './utils'; @@ -290,6 +289,7 @@ function successfulTypeScriptInstance( [configFilePath], { verbose: true, watch: true } ); + instance.solutionBuilder.buildReferences(instance.configFilePath); } if (loaderOptions.experimentalWatchApi && compiler.createWatchProgram) { @@ -337,34 +337,235 @@ function successfulTypeScriptInstance( loader._compiler.hooks.afterCompile.tapAsync( 'ts-loader', - makeAfterCompile(instance, configFilePath) + makeAfterCompile(instance, configFilePath, loader) ); loader._compiler.hooks.watchRun.tapAsync('ts-loader', makeWatchRun(instance)); return { instance }; } +function forEachResolvedProjectReference( + resolvedProjectReferences: + | readonly (typescript.ResolvedProjectReference | undefined)[] + | undefined, + cb: ( + resolvedProjectReference: typescript.ResolvedProjectReference + ) => T | undefined +): T | undefined { + let seenResolvedRefs: typescript.ResolvedProjectReference[] | undefined; + return worker(resolvedProjectReferences); + function worker( + resolvedRefs: + | readonly (typescript.ResolvedProjectReference | undefined)[] + | undefined + ): T | undefined { + if (resolvedRefs) { + for (const resolvedRef of resolvedRefs) { + if (!resolvedRef) { + continue; + } + if ( + seenResolvedRefs && + seenResolvedRefs.some(seenRef => seenRef === resolvedRef) + ) { + // ignore recursives + continue; + } + + (seenResolvedRefs || (seenResolvedRefs = [])).push(resolvedRef); + const result = cb(resolvedRef) || worker(resolvedRef.references); + if (result) { + return result; + } + } + } + return undefined; + } +} + +// This code is here as a temporary holder +function fileExtensionIs(fileName: string, ext: string) { + return fileName.endsWith(ext); +} + +function rootDirOfOptions( + instance: TSInstance, + configFile: typescript.ParsedCommandLine +) { + return ( + configFile.options.rootDir || + (instance.compiler as any).getDirectoryPath( + configFile.options.configFilePath + ) + ); +} -export function getEmitOutput(instance: TSInstance, filePath: string) { +function getOutputPathWithoutChangingExt( + instance: TSInstance, + inputFileName: string, + configFile: typescript.ParsedCommandLine, + ignoreCase: boolean, + outputDir: string | undefined +) { + return outputDir + ? (instance.compiler as any).resolvePath( + outputDir, + (instance.compiler as any).getRelativePathFromDirectory( + rootDirOfOptions(instance, configFile), + inputFileName, + ignoreCase + ) + ) + : inputFileName; +} + +function getOutputJSFileName( + instance: TSInstance, + inputFileName: string, + configFile: typescript.ParsedCommandLine, + ignoreCase: boolean +) { + if (configFile.options.emitDeclarationOnly) { + return undefined; + } + const isJsonFile = fileExtensionIs(inputFileName, '.json'); + const outputFileName = (instance.compiler as any).changeExtension( + getOutputPathWithoutChangingExt( + instance, + inputFileName, + configFile, + ignoreCase, + configFile.options.outDir + ), + isJsonFile + ? '.json' + : fileExtensionIs(inputFileName, '.tsx') && + configFile.options.jsx === instance.compiler.JsxEmit.Preserve + ? '.jsx' + : '.js' + ); + return !isJsonFile || + (instance.compiler as any).comparePaths( + inputFileName, + outputFileName, + configFile.options.configFilePath, + ignoreCase + ) !== (instance.compiler as any).Comparison.EqualTo + ? outputFileName + : undefined; +} + +function getOutputFileNames( + instance: TSInstance, + configFile: typescript.ParsedCommandLine, + inputFileName: string +): string[] { + const outputs: string[] = []; + const ignoreCase = !instance.compiler.sys.useCaseSensitiveFileNames; + const addOutput = (fileName: string | undefined) => + fileName && outputs.push(fileName); + const js = getOutputJSFileName( + instance, + inputFileName, + configFile, + ignoreCase + ); + addOutput(js); + if (!fileExtensionIs(inputFileName, '.json')) { + if (js && configFile.options.sourceMap) { + addOutput(`${js}.map`); + } + if ( + (configFile.options.declaration || configFile.options.composite) && + (instance.compiler as any).hasTSFileExtension(inputFileName) + ) { + const dts = (instance.compiler as any).getOutputDeclarationFileName( + inputFileName, + configFile, + ignoreCase + ); + addOutput(dts); + if (configFile.options.declarationMap) { + addOutput(`${dts}.map`); + } + } + } + + return outputs; +} + +function getOutputFilesFromReference( + program: typescript.Program, + instance: TSInstance, + filePath: string +): typescript.OutputFile[] | undefined { + // May be api to get file + const refs = program.getResolvedProjectReferences(); + return refs && instance.solutionBuilderHost + ? forEachResolvedProjectReference(refs, ({ commandLine }) => { + const { options, fileNames } = commandLine; + if ( + !options.outFile && + !options.out && + fileNames.some(file => path.normalize(file) === filePath) + ) { + // TODO api in typescript + // For now copying from typescript + const outputFiles: typescript.OutputFile[] = []; + getOutputFileNames( + instance, + commandLine, + (instance.compiler as any).resolvePath(filePath) + ).forEach(name => { + const text = instance.compiler.sys.readFile(name); + if (text) { + outputFiles.push({ name, text, writeByteOrderMark: false }); + } + }); + return outputFiles; + } + return undefined; + }) + : undefined; +} + +export function getEmitOutput( + instance: TSInstance, + filePath: string, + loaderContext: webpack.loader.LoaderContext +) { const program = ensureProgram(instance); if (program !== undefined) { - const outputFiles: typescript.OutputFile[] = []; - const writeFile = ( - fileName: string, - text: string, - writeByteOrderMark: boolean - ) => outputFiles.push({ name: fileName, writeByteOrderMark, text }); const sourceFile = program.getSourceFile(filePath); // The source file will be undefined if it’s part of an unbuilt project reference - if (sourceFile !== undefined || !isUsingProjectReferences(instance)) { - program.emit( - sourceFile, - writeFile, - /*cancellationToken*/ undefined, - /*emitOnlyDtsFiles*/ false, - instance.transformers - ); + if (sourceFile) { + if (path.resolve(sourceFile.fileName) !== path.resolve(filePath)) { + const outputFiles = getOutputFilesFromReference( + program, + instance, + filePath + ); + if (outputFiles) { + return outputFiles; + } + loaderContext.emitWarning(`No output found for ${filePath}`); + } else { + const outputFiles: typescript.OutputFile[] = []; + const writeFile = ( + fileName: string, + text: string, + writeByteOrderMark: boolean + ) => outputFiles.push({ name: fileName, writeByteOrderMark, text }); + program.emit( + sourceFile, + writeFile, + /*cancellationToken*/ undefined, + /*emitOnlyDtsFiles*/ false, + instance.transformers + ); + return outputFiles; + } } - return outputFiles; + return []; } else { // Emit Javascript return instance.languageService!.getProgram()!.getSourceFile(filePath) === diff --git a/src/interfaces.ts b/src/interfaces.ts index b2d9fe25c..430d0134a 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -49,6 +49,39 @@ export interface WatchHost updateRootFileNames(): void; } +export type WatchCallbacks = { [fileName: string]: T[] | undefined }; +export interface WatchFactory { + watchedFiles: WatchCallbacks; + watchedDirectories: WatchCallbacks; + watchedDirectoriesRecursive: WatchCallbacks< + typescript.DirectoryWatcherCallback + >; + invokeFileWatcher( + fileName: string, + eventKind: typescript.FileWatcherEventKind + ): void; + invokeDirectoryWatcher(directory: string, fileAddedOrRemoved: string): void; + /** Used to watch changes in source files, missing files needed to update the program or config file */ + watchFile( + path: string, + callback: typescript.FileWatcherCallback, + pollingInterval?: number + ): typescript.FileWatcher; + /** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */ + watchDirectory( + path: string, + callback: typescript.DirectoryWatcherCallback, + recursive?: boolean + ): typescript.FileWatcher; +} + +export interface SolutionBuilderWithWatchHost + extends typescript.SolutionBuilderWithWatchHost< + typescript.EmitAndSemanticDiagnosticsBuilderProgram + > { + diagnostics: typescript.Diagnostic[]; +} + export interface TSInstance { compiler: typeof typescript; compilerOptions: typescript.CompilerOptions; @@ -87,9 +120,7 @@ export interface TSInstance { hasUnaccountedModifiedFiles?: boolean; changedFilesList?: boolean; - solutionBuilderHost?: typescript.SolutionBuilderWithWatchHost< - typescript.EmitAndSemanticDiagnosticsBuilderProgram - >; + solutionBuilderHost?: SolutionBuilderWithWatchHost; solutionBuilder?: typescript.SolutionBuilder< typescript.EmitAndSemanticDiagnosticsBuilderProgram >; diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 27ebbfb14..226639d8f 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -11,7 +11,10 @@ import { ModuleResolutionHost, ResolvedModule, ResolveSync, + SolutionBuilderWithWatchHost, TSInstance, + WatchCallbacks, + WatchFactory, WatchHost } from './interfaces'; import * as logger from './logger'; @@ -238,6 +241,150 @@ function makeResolvers( }; } +function createWatchFactory(): WatchFactory { + const watchedFiles: WatchCallbacks = {}; + const watchedDirectories: WatchCallbacks< + typescript.DirectoryWatcherCallback + > = {}; + const watchedDirectoriesRecursive: WatchCallbacks< + typescript.DirectoryWatcherCallback + > = {}; + + return { + watchedFiles, + watchedDirectories, + watchedDirectoriesRecursive, + invokeFileWatcher, + invokeDirectoryWatcher, + watchFile, + watchDirectory + }; + + function invokeWatcherCallbacks( + callbacks: typescript.FileWatcherCallback[] | undefined, + fileName: string, + eventKind: typescript.FileWatcherEventKind + ): void; + function invokeWatcherCallbacks( + callbacks: typescript.DirectoryWatcherCallback[] | undefined, + fileName: string + ): void; + function invokeWatcherCallbacks( + callbacks: + | typescript.FileWatcherCallback[] + | typescript.DirectoryWatcherCallback[] + | undefined, + fileName: string, + eventKind?: typescript.FileWatcherEventKind + ) { + if (callbacks !== undefined) { + // The array copy is made to ensure that even if one of the callback removes the callbacks, + // we dont miss any callbacks following it + const cbs = callbacks.slice(); + for (const cb of cbs) { + cb(fileName, eventKind as typescript.FileWatcherEventKind); + } + } + } + + function invokeFileWatcher( + fileName: string, + eventKind: typescript.FileWatcherEventKind + ) { + fileName = path.normalize(fileName); + invokeWatcherCallbacks(watchedFiles[fileName], fileName, eventKind); + } + + function invokeDirectoryWatcher( + directory: string, + fileAddedOrRemoved: string + ) { + directory = path.normalize(directory); + invokeWatcherCallbacks(watchedDirectories[directory], fileAddedOrRemoved); + invokeRecursiveDirectoryWatcher(directory, fileAddedOrRemoved); + } + + function invokeRecursiveDirectoryWatcher( + directory: string, + fileAddedOrRemoved: string + ) { + directory = path.normalize(directory); + invokeWatcherCallbacks( + watchedDirectoriesRecursive[directory], + fileAddedOrRemoved + ); + const basePath = path.dirname(directory); + if (directory !== basePath) { + invokeRecursiveDirectoryWatcher(basePath, fileAddedOrRemoved); + } + } + + function createWatcher( + file: string, + callbacks: WatchCallbacks, + callback: T + ): typescript.FileWatcher { + file = path.normalize(file); + const existing = callbacks[file]; + if (existing === undefined) { + callbacks[file] = [callback]; + } else { + existing.push(callback); + } + return { + close: () => { + // tslint:disable-next-line:no-shadowed-variable + const existing = callbacks[file]; + if (existing !== undefined) { + unorderedRemoveItem(existing, callback); + } + } + }; + } + + function watchFile( + fileName: string, + callback: typescript.FileWatcherCallback, + _pollingInterval?: number + ) { + return createWatcher(fileName, watchedFiles, callback); + } + + function watchDirectory( + fileName: string, + callback: typescript.DirectoryWatcherCallback, + recursive?: boolean + ) { + return createWatcher( + fileName, + recursive === true ? watchedDirectoriesRecursive : watchedDirectories, + callback + ); + } +} + +export function updateFileWithText( + instance: TSInstance, + filePath: string, + text: (nFilePath: string) => string +) { + const nFilePath = path.normalize(filePath); + const file = + instance.files.get(nFilePath) || instance.otherFiles.get(nFilePath); + if (file !== undefined) { + file.text = text(nFilePath); + file.version++; + instance.version!++; + instance.modifiedFiles!.set(nFilePath, file); + if (instance.watchHost !== undefined) { + instance.watchHost.invokeFileWatcher( + nFilePath, + instance.compiler.FileWatcherEventKind.Changed + ); + } + } +} + /** * Create the TypeScript Watch host */ @@ -285,15 +432,12 @@ export function makeWatchHost( // loader.context seems to work fine on Linux / Mac regardless causes problems for @types resolution on Windows for TypeScript < 2.3 const getCurrentDirectory = () => loader.context; - type WatchCallbacks = { [fileName: string]: T[] | undefined }; - const watchedFiles: WatchCallbacks = {}; - const watchedDirectories: WatchCallbacks< - typescript.DirectoryWatcherCallback - > = {}; - const watchedDirectoriesRecursive: WatchCallbacks< - typescript.DirectoryWatcherCallback - > = {}; - + const { + watchFile, + watchDirectory, + invokeFileWatcher, + invokeDirectoryWatcher + } = createWatchFactory(); const resolvers = makeResolvers( compiler, compilerOptions, @@ -380,108 +524,6 @@ export function makeWatchHost( return files.has(filePath) || compiler.sys.fileExists(filePath); } - function invokeWatcherCallbacks( - callbacks: typescript.FileWatcherCallback[] | undefined, - fileName: string, - eventKind: typescript.FileWatcherEventKind - ): void; - function invokeWatcherCallbacks( - callbacks: typescript.DirectoryWatcherCallback[] | undefined, - fileName: string - ): void; - function invokeWatcherCallbacks( - callbacks: - | typescript.FileWatcherCallback[] - | typescript.DirectoryWatcherCallback[] - | undefined, - fileName: string, - eventKind?: typescript.FileWatcherEventKind - ) { - if (callbacks !== undefined) { - // The array copy is made to ensure that even if one of the callback removes the callbacks, - // we dont miss any callbacks following it - const cbs = callbacks.slice(); - for (const cb of cbs) { - cb(fileName, eventKind as typescript.FileWatcherEventKind); - } - } - } - - function invokeFileWatcher( - fileName: string, - eventKind: typescript.FileWatcherEventKind - ) { - fileName = path.normalize(fileName); - invokeWatcherCallbacks(watchedFiles[fileName], fileName, eventKind); - } - - function invokeDirectoryWatcher( - directory: string, - fileAddedOrRemoved: string - ) { - directory = path.normalize(directory); - invokeWatcherCallbacks(watchedDirectories[directory], fileAddedOrRemoved); - invokeRecursiveDirectoryWatcher(directory, fileAddedOrRemoved); - } - - function invokeRecursiveDirectoryWatcher( - directory: string, - fileAddedOrRemoved: string - ) { - directory = path.normalize(directory); - invokeWatcherCallbacks( - watchedDirectoriesRecursive[directory], - fileAddedOrRemoved - ); - const basePath = path.dirname(directory); - if (directory !== basePath) { - invokeRecursiveDirectoryWatcher(basePath, fileAddedOrRemoved); - } - } - - function createWatcher( - file: string, - callbacks: WatchCallbacks, - callback: T - ): typescript.FileWatcher { - file = path.normalize(file); - const existing = callbacks[file]; - if (existing === undefined) { - callbacks[file] = [callback]; - } else { - existing.push(callback); - } - return { - close: () => { - // tslint:disable-next-line:no-shadowed-variable - const existing = callbacks[file]; - if (existing !== undefined) { - unorderedRemoveItem(existing, callback); - } - } - }; - } - - function watchFile( - fileName: string, - callback: typescript.FileWatcherCallback, - _pollingInterval?: number - ) { - return createWatcher(fileName, watchedFiles, callback); - } - - function watchDirectory( - fileName: string, - callback: typescript.DirectoryWatcherCallback, - recursive?: boolean - ) { - return createWatcher( - fileName, - recursive === true ? watchedDirectoriesRecursive : watchedDirectories, - callback - ); - } - function createBuilderProgramWithReferences( rootNames: ReadonlyArray | undefined, options: typescript.CompilerOptions | undefined, @@ -518,7 +560,7 @@ export function makeSolutionBuilderHost( log: logger.Logger, loader: webpack.loader.LoaderContext, instance: TSInstance -) { +): SolutionBuilderWithWatchHost { const { compiler, compilerOptions, @@ -539,8 +581,13 @@ export function makeSolutionBuilderHost( getNewLine: () => compiler.sys.newLine }; - const reportDiagnostic = (d: typescript.Diagnostic) => - log.logError(compiler.formatDiagnostic(d, formatDiagnosticHost)); + const reportDiagnostic = (d: typescript.Diagnostic) => { + solutionBuilderHost.diagnostics.push(d); + log.logInfo(compiler.formatDiagnostic(d, formatDiagnosticHost)); + }; + + const { watchFile, watchDirectory, watchedFiles } = createWatchFactory(); + const reportSolutionBuilderStatus = (d: typescript.Diagnostic) => log.logInfo(compiler.formatDiagnostic(d, formatDiagnosticHost)); const reportWatchStatus = ( @@ -554,17 +601,26 @@ export function makeSolutionBuilderHost( compiler.sys.newLine )}${newLine + newLine}` ); - const solutionBuilderHost = compiler.createSolutionBuilderWithWatchHost( - compiler.sys, - compiler.createEmitAndSemanticDiagnosticsBuilderProgram, - reportDiagnostic, - reportSolutionBuilderStatus, - reportWatchStatus - ); + const solutionBuilderHost: SolutionBuilderWithWatchHost = { + ...compiler.createSolutionBuilderWithWatchHost( + compiler.sys, + compiler.createEmitAndSemanticDiagnosticsBuilderProgram, + reportDiagnostic, + reportSolutionBuilderStatus, + reportWatchStatus + ), + diagnostics: [], + watchFile: builderWatchFile, + watchDirectory + }; solutionBuilderHost.getCurrentDirectory = getCurrentDirectory; solutionBuilderHost.trace = logData => log.logInfo(logData); solutionBuilderHost.getParsedCommandLine = file => getParsedCommandLine(compiler, instance.loaderOptions, file); + solutionBuilderHost.writeFile = (name, text, writeByteOrderMark) => { + compiler.sys.writeFile(name, text, writeByteOrderMark); + updateFileWithText(instance, name, () => text); + }; // make a (sync) resolver that follows webpack's rules const resolveSync = makeResolver(loader._compiler.options); @@ -585,6 +641,54 @@ export function makeSolutionBuilderHost( solutionBuilderHost.resolveModuleNames = resolvers.resolveModuleNames; return solutionBuilderHost; + + function builderWatchFile( + fileName: string, + callback: typescript.FileWatcherCallback, + pollingInterval?: number + ) { + loader.addDependency(path.resolve(fileName)); + const watcher = watchFile(fileName, callback, pollingInterval); + return { + close() { + watcher.close(); + updateDependencies(); + } + }; + } + + // TODO:: + // function builderWatchDirectory(path: string, callback: typescript.DirectoryWatcherCallback, recursive?: boolean) { + // loader.addContextDependency(path); + // const watcher = watchDirectory(path, callback, recursive); + // return { + // close() { + // watcher.close(); + // updateDependencies(); + // } + // }; + // } + + function updateDependencies() { + loader.clearDependencies(); + for (const key in watchedFiles) { + if (Object.prototype.hasOwnProperty.call(watchedFiles, key)) { + loader.addDependency(key); + } + } + + // TODO:: + // for (const key in watchedDirectories) { + // if (Object.prototype.hasOwnProperty.call(watchedDirectories, key)) { + // loader.addContextDependency(key); + // } + // } + // for (const key in watchedDirectoriesRecursive) { + // if (Object.prototype.hasOwnProperty.call(watchedDirectoriesRecursive, key)) { + // loader.addContextDependency(key); + // } + // } + } } type ResolveTypeReferenceDirective = ( diff --git a/src/utils.ts b/src/utils.ts index 2383b44d1..8c5e3b3be 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -3,7 +3,6 @@ import * as fs from 'fs'; import * as micromatch from 'micromatch'; import * as path from 'path'; import * as typescript from 'typescript'; -import * as webpack from 'webpack'; import constants = require('./constants'); import { @@ -258,156 +257,9 @@ export function ensureProgram(instance: TSInstance) { return instance.program; } -export function supportsProjectReferences(instance: TSInstance) { - const program = ensureProgram(instance); - return program && !!program.getProjectReferences; -} - -export function isUsingProjectReferences(instance: TSInstance) { - if ( - instance.loaderOptions.projectReferences && - supportsProjectReferences(instance) - ) { - const program = ensureProgram(instance); - return Boolean(program && program.getProjectReferences()); - } - return false; -} - -/** - * Gets the project reference for a file from the cache if it exists, - * or gets it from TypeScript and caches it otherwise. - */ -export function getAndCacheProjectReference( - filePath: string, - instance: TSInstance -) { - const file = instance.files.get(filePath); - if (file !== undefined && file.projectReference) { - return file.projectReference.project; - } - - const projectReference = getProjectReferenceForFile(filePath, instance); - if (file !== undefined) { - file.projectReference = { project: projectReference }; - } - - return projectReference; -} - -function getResolvedProjectReferences( - program: typescript.Program -): typescript.ResolvedProjectReference[] | undefined { - const getProjectReferences = - (program as any).getResolvedProjectReferences || - program.getProjectReferences; - if (getProjectReferences) { - return getProjectReferences(); - } - return; -} - -function getProjectReferenceForFile(filePath: string, instance: TSInstance) { - if (isUsingProjectReferences(instance)) { - const program = ensureProgram(instance); - return ( - program && - getResolvedProjectReferences(program)!.find( - ref => - (ref && - ref.commandLine.fileNames.some( - file => path.normalize(file) === filePath - )) || - false - ) - ); - } - - return; -} - -export function validateSourceMapOncePerProject( - instance: TSInstance, - loader: webpack.loader.LoaderContext, - jsFileName: string, - project: typescript.ResolvedProjectReference -) { - const { projectsMissingSourceMaps = new Set() } = instance; - if (!projectsMissingSourceMaps.has(project.sourceFile.fileName)) { - instance.projectsMissingSourceMaps = projectsMissingSourceMaps; - projectsMissingSourceMaps.add(project.sourceFile.fileName); - const mapFileName = jsFileName + '.map'; - if (!instance.compiler.sys.fileExists(mapFileName)) { - const [relativeJSPath, relativeProjectConfigPath] = [ - path.relative(loader.rootContext, jsFileName), - path.relative(loader.rootContext, project.sourceFile.fileName) - ]; - loader.emitWarning( - new Error( - 'Could not find source map file for referenced project output ' + - `${relativeJSPath}. Ensure the 'sourceMap' compiler option ` + - `is enabled in ${relativeProjectConfigPath} to ensure Webpack ` + - 'can map project references to the appropriate source files.' - ) - ); - } - } -} - export function supportsSolutionBuild( loaderOptions: LoaderOptions, compiler: typeof typescript ) { return !!loaderOptions.projectReferences && !!compiler.InvalidatedProjectKind; } - -/** - * Gets the output JS file path for an input file governed by a composite project. - * Pulls from the cache if it exists; computes and caches the result otherwise. - */ -export function getAndCacheOutputJSFileName( - inputFileName: string, - projectReference: typescript.ResolvedProjectReference, - instance: TSInstance -) { - const file = instance.files.get(inputFileName); - if (file && file.projectReference && file.projectReference.outputFileName) { - return file.projectReference.outputFileName; - } - - const outputFileName = getOutputJavaScriptFileName( - inputFileName, - projectReference - ); - - if (file !== undefined) { - file.projectReference = file.projectReference || { - project: projectReference - }; - file.projectReference.outputFileName = outputFileName; - } - - return outputFileName; -} - -// Adapted from https://github.com/Microsoft/TypeScript/blob/45101491c0b077c509b25830ef0ee5f85b293754/src/compiler/tsbuild.ts#L305 -function getOutputJavaScriptFileName( - inputFileName: string, - projectReference: typescript.ResolvedProjectReference -) { - const { options } = projectReference.commandLine; - const projectDirectory = - options.rootDir || path.dirname(projectReference.sourceFile.fileName); - const relativePath = path.relative(projectDirectory, inputFileName); - const outputPath = path.resolve( - options.outDir || projectDirectory, - relativePath - ); - const newExtension = constants.jsonRegex.test(inputFileName) - ? '.json' - : constants.tsxRegex.test(inputFileName) && - options.jsx === typescript.JsxEmit.Preserve - ? '.jsx' - : '.js'; - return outputPath.replace(constants.extensionRegex, newExtension); -} diff --git a/src/watch-run.ts b/src/watch-run.ts index e6e8d8fcb..2e8664474 100644 --- a/src/watch-run.ts +++ b/src/watch-run.ts @@ -1,8 +1,8 @@ -import * as path from 'path'; import * as webpack from 'webpack'; import * as constants from './constants'; import { TSFile, TSInstance } from './interfaces'; +import { updateFileWithText } from './servicesHost'; import { readFile } from './utils'; /** @@ -49,19 +49,9 @@ export function makeWatchRun(instance: TSInstance) { } function updateFile(instance: TSInstance, filePath: string) { - const nFilePath = path.normalize(filePath); - const file = - instance.files.get(nFilePath) || instance.otherFiles.get(nFilePath); - if (file !== undefined) { - file.text = readFile(nFilePath) || ''; - file.version++; - instance.version!++; - instance.modifiedFiles!.set(nFilePath, file); - if (instance.watchHost !== undefined) { - instance.watchHost.invokeFileWatcher( - nFilePath, - instance.compiler.FileWatcherEventKind.Changed - ); - } - } + updateFileWithText( + instance, + filePath, + nFilePath => readFile(nFilePath) || '' + ); } From b38854c388fd0ebe47d72078b1b7ea1f4e559beb Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 13 Sep 2019 16:52:16 -0700 Subject: [PATCH 02/19] Try with --watch --- src/index.ts | 102 ++++++++++++++++++++++++++++++-------------- src/instances.ts | 7 +++ src/interfaces.ts | 5 ++- src/servicesHost.ts | 17 +++++++- 4 files changed, 94 insertions(+), 37 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3094638aa..ec60cbed2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,11 @@ import * as typescript from 'typescript'; import * as webpack from 'webpack'; import * as constants from './constants'; -import { getEmitOutput, getTypeScriptInstance } from './instances'; +import { + getEmitOutput, + getTypeScriptInstance, + isReferencedFile +} from './instances'; import { LoaderOptions, LoaderOptionsCache, @@ -271,19 +275,33 @@ function updateFileInCache( if (file === undefined) { file = instance.otherFiles.get(filePath); if (file !== undefined) { - instance.otherFiles.delete(filePath); - instance.files.set(filePath, file); + if (!isReferencedFile(instance, filePath)) { + instance.otherFiles.delete(filePath); + instance.files.set(filePath, file); + instance.changedFilesList = true; + } } else { - if (instance.watchHost !== undefined) { + if ( + instance.watchHost !== undefined || + instance.solutionBuilderHost !== undefined + ) { fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Created; } file = { version: 0 }; - instance.files.set(filePath, file); + if (!isReferencedFile(instance, filePath)) { + instance.files.set(filePath, file); + instance.changedFilesList = true; + } else { + instance.otherFiles.set(filePath, file); + } } - instance.changedFilesList = true; } - if (instance.watchHost !== undefined && contents === undefined) { + if ( + (instance.watchHost !== undefined || + instance.solutionBuilderHost !== undefined) && + contents === undefined + ) { fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Deleted; } @@ -294,6 +312,7 @@ function updateFileInCache( // // See https://github.com/TypeStrong/ts-loader/issues/943 if ( + !isReferencedFile(instance, filePath) && !instance.rootFileNames.has(filePath) && // however, be careful not to add files from node_modules unless // it is allowed by the options. @@ -308,7 +327,8 @@ function updateFileInCache( file.text = contents; instance.version!++; if ( - instance.watchHost !== undefined && + (instance.watchHost !== undefined || + instance.solutionBuilderHost !== undefined) && fileWatcherEventKind === undefined ) { fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Changed; @@ -321,6 +341,20 @@ function updateFileInCache( instance.watchHost.invokeDirectoryWatcher(path.dirname(filePath), filePath); } + if ( + instance.solutionBuilderHost !== undefined && + fileWatcherEventKind !== undefined + ) { + instance.solutionBuilderHost.invokeFileWatcher( + filePath, + fileWatcherEventKind + ); + instance.solutionBuilderHost.invokeDirectoryWatcher( + path.dirname(filePath), + filePath + ); + } + // push this file to modified files hash. if (instance.modifiedFiles === null || instance.modifiedFiles === undefined) { instance.modifiedFiles = new Map(); @@ -338,36 +372,38 @@ function getEmit( ) { const outputFiles = getEmitOutput(instance, filePath, loaderContext); - loaderContext.clearDependencies(); - loaderContext.addDependency(rawFilePath); + if (!isReferencedFile(instance, filePath)) { + loaderContext.clearDependencies(); + loaderContext.addDependency(rawFilePath); - const allDefinitionFiles = [...instance.files.keys()].filter(defFilePath => - defFilePath.match(constants.dtsDtsxOrDtsDtsxMapRegex) - ); + const allDefinitionFiles = [...instance.files.keys()].filter(defFilePath => + defFilePath.match(constants.dtsDtsxOrDtsDtsxMapRegex) + ); - // Make this file dependent on *all* definition files in the program - const addDependency = loaderContext.addDependency.bind(loaderContext); - allDefinitionFiles.forEach(addDependency); + // Make this file dependent on *all* definition files in the program + const addDependency = loaderContext.addDependency.bind(loaderContext); + allDefinitionFiles.forEach(addDependency); - // Additionally make this file dependent on all imported files - const fileDependencies = instance.dependencyGraph[filePath]; - const additionalDependencies = - fileDependencies === undefined - ? [] - : fileDependencies.map(({ originalFileName }) => originalFileName); + // Additionally make this file dependent on all imported files + const fileDependencies = instance.dependencyGraph[filePath]; + const additionalDependencies = + fileDependencies === undefined + ? [] + : fileDependencies.map(({ originalFileName }) => originalFileName); - if (additionalDependencies.length > 0) { - additionalDependencies.forEach(addDependency); - } + if (additionalDependencies.length > 0) { + additionalDependencies.forEach(addDependency); + } - loaderContext._module.buildMeta.tsLoaderDefinitionFileVersions = allDefinitionFiles - .concat(additionalDependencies) - .map( - defFilePath => - defFilePath + - '@' + - (instance.files.get(defFilePath) || { version: '?' }).version - ); + loaderContext._module.buildMeta.tsLoaderDefinitionFileVersions = allDefinitionFiles + .concat(additionalDependencies) + .map( + defFilePath => + defFilePath + + '@' + + (instance.files.get(defFilePath) || { version: '?' }).version + ); + } const outputFile = outputFiles .filter(file => file.name.match(constants.jsJsx)) diff --git a/src/instances.ts b/src/instances.ts index 5a45044d1..8118b4b00 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -528,6 +528,13 @@ function getOutputFilesFromReference( : undefined; } +export function isReferencedFile(instance: TSInstance, filePath: string) { + return ( + !!instance.solutionBuilderHost && + !!instance.solutionBuilderHost.watchedFiles[filePath] + ); +} + export function getEmitOutput( instance: TSInstance, filePath: string, diff --git a/src/interfaces.ts b/src/interfaces.ts index 430d0134a..7aa20dfb8 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -77,8 +77,9 @@ export interface WatchFactory { export interface SolutionBuilderWithWatchHost extends typescript.SolutionBuilderWithWatchHost< - typescript.EmitAndSemanticDiagnosticsBuilderProgram - > { + typescript.EmitAndSemanticDiagnosticsBuilderProgram + >, + WatchFactory { diagnostics: typescript.Diagnostic[]; } diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 226639d8f..72def835f 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -382,6 +382,12 @@ export function updateFileWithText( instance.compiler.FileWatcherEventKind.Changed ); } + if (instance.solutionBuilderHost !== undefined) { + instance.solutionBuilderHost.invokeFileWatcher( + nFilePath, + instance.compiler.FileWatcherEventKind.Changed + ); + } } } @@ -586,7 +592,12 @@ export function makeSolutionBuilderHost( log.logInfo(compiler.formatDiagnostic(d, formatDiagnosticHost)); }; - const { watchFile, watchDirectory, watchedFiles } = createWatchFactory(); + const { + watchFile, + watchDirectory, + watchedFiles, + ...rest + } = createWatchFactory(); const reportSolutionBuilderStatus = (d: typescript.Diagnostic) => log.logInfo(compiler.formatDiagnostic(d, formatDiagnosticHost)); @@ -611,7 +622,9 @@ export function makeSolutionBuilderHost( ), diagnostics: [], watchFile: builderWatchFile, - watchDirectory + watchDirectory, + watchedFiles, + ...rest }; solutionBuilderHost.getCurrentDirectory = getCurrentDirectory; solutionBuilderHost.trace = logData => log.logInfo(logData); From 23d3e905685a51d69d84e4b6f5bbbd3a19abf3d9 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 16 Sep 2019 12:29:45 -0700 Subject: [PATCH 03/19] More fixes --- src/instances.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/instances.ts b/src/instances.ts index 8118b4b00..0fe13473c 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -499,7 +499,8 @@ function getOutputFilesFromReference( filePath: string ): typescript.OutputFile[] | undefined { // May be api to get file - const refs = program.getResolvedProjectReferences(); + const refs = + instance.solutionBuilderHost && program.getResolvedProjectReferences(); return refs && instance.solutionBuilderHost ? forEachResolvedProjectReference(refs, ({ commandLine }) => { const { options, fileNames } = commandLine; From d6fb955ccdca94820af390a8dea6807a4ccc0ca5 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 16 Sep 2019 12:38:18 -0700 Subject: [PATCH 04/19] Tests for errors --- .../app.ts | 3 + .../expectedOutput-3.6/bundle.js | 113 ++++++++++++++++++ .../expectedOutput-3.6/bundle.transpiled.js | 113 ++++++++++++++++++ .../expectedOutput-3.6/output.transpiled.txt | 9 ++ .../expectedOutput-3.6/output.txt | 11 ++ .../lib/.gitignore | 1 + .../lib/index.ts | 5 + .../lib/tsconfig.json | 9 ++ .../tsconfig.json | 5 + .../webpack.config.js | 19 +++ .../app.ts | 3 + .../expectedOutput-3.6/bundle.js | 112 +++++++++++++++++ .../expectedOutput-3.6/bundle.transpiled.js | 113 ++++++++++++++++++ .../expectedOutput-3.6/output.transpiled.txt | 9 ++ .../expectedOutput-3.6/output.txt | 19 +++ .../lib/.gitignore | 1 + .../lib/index.ts | 6 + .../lib/tsconfig.json | 9 ++ .../tsconfig.json | 5 + .../webpack.config.js | 19 +++ .../app.ts | 3 + .../expectedOutput-3.6/bundle.js | 112 +++++++++++++++++ .../expectedOutput-3.6/bundle.transpiled.js | 113 ++++++++++++++++++ .../expectedOutput-3.6/output.transpiled.txt | 15 +++ .../expectedOutput-3.6/output.txt | 19 +++ .../lib/.gitignore | 1 + .../lib/index.ts | 5 + .../lib/tsconfig.json | 9 ++ .../tsconfig.json | 5 + .../webpack.config.js | 19 +++ 30 files changed, 885 insertions(+) create mode 100644 test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/app.ts create mode 100644 test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/bundle.js create mode 100644 test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.txt create mode 100644 test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/.gitignore create mode 100644 test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/index.ts create mode 100644 test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/webpack.config.js create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/app.ts create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/.gitignore create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/webpack.config.js create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/app.ts create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/.gitignore create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.ts create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/webpack.config.js diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/app.ts b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/app.ts new file mode 100644 index 000000000..1ec5a0aa0 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/app.ts @@ -0,0 +1,3 @@ +import { lib } from './lib'; + +console.log(lib.one, lib.two, lib.three, lib.four); diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/bundle.js new file mode 100644 index 000000000..9665c6661 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/bundle.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/bundle.transpiled.js b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/bundle.transpiled.js new file mode 100644 index 000000000..6cc3ae78e --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/bundle.transpiled.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.transpiled.txt new file mode 100644 index 000000000..f557d19c9 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.transpiled.txt @@ -0,0 +1,9 @@ + Asset Size Chunks Chunk Names +bundle.js 4.37 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 183 bytes {main} [built] [1 error] +[./lib/index.ts] 133 bytes {main} [built] + +ERROR in tsconfig.json +[tsl] ERROR + TS6305: Output file '/.test/projectReferencesNotBuilt_ErrorInProject/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_ErrorInProject/lib/index.ts'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.txt new file mode 100644 index 000000000..4e1e2aa4d --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.txt @@ -0,0 +1,11 @@ + Asset Size Chunks Chunk Names + bundle.js 4.31 KiB main [emitted] main +../lib/index.d.ts 89 bytes [emitted] +Entrypoint main = bundle.js +[./app.ts] 147 bytes {main} [built] [1 error] +[./lib/index.ts] 104 bytes {main} [built] + +ERROR in app.ts +./app.ts +[tsl] ERROR in app.ts(3,46) + TS2339: Property 'four' does not exist on type '{ one: number; two: number; three: number; }'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/.gitignore b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/.gitignore new file mode 100644 index 000000000..7b7f62099 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/.gitignore @@ -0,0 +1 @@ +!*.js.map \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/index.ts b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/index.ts new file mode 100644 index 000000000..669ca7b3d --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/index.ts @@ -0,0 +1,5 @@ +export const lib = { + one: 1, + two: 2, + three: 3 +}; diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/tsconfig.json b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/tsconfig.json new file mode 100644 index 000000000..506c325eb --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/lib/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "composite": true, + "sourceMap": true + }, + "files": [ + "./index.ts" + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/tsconfig.json b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/tsconfig.json new file mode 100644 index 000000000..03974daa7 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/tsconfig.json @@ -0,0 +1,5 @@ +{ + "references": [ + { "path": "./lib" } + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/webpack.config.js b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/webpack.config.js new file mode 100644 index 000000000..0dca2dae2 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/webpack.config.js @@ -0,0 +1,19 @@ +var path = require('path') + +module.exports = { + mode: 'development', + entry: './app.ts', + output: { + filename: 'bundle.js' + }, + resolve: { + extensions: ['.ts', '.js'] + }, + module: { + rules: [ + { test: /\.ts$/, loader: 'ts-loader', options: { projectReferences: true } } + ] + } +} + + diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/app.ts b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/app.ts new file mode 100644 index 000000000..a83f2065b --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/app.ts @@ -0,0 +1,3 @@ +import { lib } from './lib'; + +console.log(lib.one, lib.two, lib.three); diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js new file mode 100644 index 000000000..0d4a06ada --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js @@ -0,0 +1,112 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesNotBuilt_SemanticErrorInReference//lib//index.ts./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:45:15)/n at successLoader (c://github//ts-loader//dist//index.js:36:5)/n at Object.loader (c://github//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.transpiled.js b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.transpiled.js new file mode 100644 index 000000000..12b30effa --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.transpiled.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n};\nvar y = 10;\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt new file mode 100644 index 000000000..f313e931f --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt @@ -0,0 +1,9 @@ + Asset Size Chunks Chunk Names +bundle.js 4.37 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 167 bytes {main} [built] [1 error] +[./lib/index.ts] 145 bytes {main} [built] + +ERROR in tsconfig.json +[tsl] ERROR + TS6305: Output file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt new file mode 100644 index 000000000..44439e40a --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt @@ -0,0 +1,19 @@ + Asset Size Chunks Chunk Names +bundle.js 4.61 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 131 bytes {main} [built] +[./lib/index.ts] 426 bytes {main} [built] [failed] [1 error] + +ERROR in ./lib/index.ts +Module build failed (from /index.js): +Error: TypeScript emitted no output for lib\index.ts. + at makeSourceMapAndFinish (dist\index.js:45:15) + at successLoader (dist\index.js:36:5) + at Object.loader (dist\index.js:22:12) + @ ./app.ts 3:12-28 + +ERROR in tsconfig.json +[tsl] ERROR + TS6305: Output file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts'. + +ERROR in undefined \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/.gitignore b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/.gitignore new file mode 100644 index 000000000..7b7f62099 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/.gitignore @@ -0,0 +1 @@ +!*.js.map \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts new file mode 100644 index 000000000..1cede47f6 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts @@ -0,0 +1,6 @@ +export const lib = { + one: 1, + two: 2, + three: 3 +}; +const y: string = 10; diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/tsconfig.json b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/tsconfig.json new file mode 100644 index 000000000..506c325eb --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/lib/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "composite": true, + "sourceMap": true + }, + "files": [ + "./index.ts" + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/tsconfig.json b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/tsconfig.json new file mode 100644 index 000000000..03974daa7 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/tsconfig.json @@ -0,0 +1,5 @@ +{ + "references": [ + { "path": "./lib" } + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/webpack.config.js b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/webpack.config.js new file mode 100644 index 000000000..0dca2dae2 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/webpack.config.js @@ -0,0 +1,19 @@ +var path = require('path') + +module.exports = { + mode: 'development', + entry: './app.ts', + output: { + filename: 'bundle.js' + }, + resolve: { + extensions: ['.ts', '.js'] + }, + module: { + rules: [ + { test: /\.ts$/, loader: 'ts-loader', options: { projectReferences: true } } + ] + } +} + + diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/app.ts b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/app.ts new file mode 100644 index 000000000..a83f2065b --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/app.ts @@ -0,0 +1,3 @@ +import { lib } from './lib'; + +console.log(lib.one, lib.two, lib.three); diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js new file mode 100644 index 000000000..bca6d3c8c --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js @@ -0,0 +1,112 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesNotBuilt_SyntaxErrorInReference//lib//index.ts./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:45:15)/n at successLoader (c://github//ts-loader//dist//index.js:36:5)/n at Object.loader (c://github//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.transpiled.js b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.transpiled.js new file mode 100644 index 000000000..cf22a4206 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.transpiled.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3,\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt new file mode 100644 index 000000000..a1ebd4496 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt @@ -0,0 +1,15 @@ + Asset Size Chunks Chunk Names +bundle.js 4.36 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 167 bytes {main} [built] [1 error] +[./lib/index.ts] 134 bytes {main} [built] [1 error] + +ERROR in tsconfig.json +[tsl] ERROR + TS6305: Output file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.ts'. + +ERROR in lib\index.ts +./lib/index.ts +[tsl] ERROR in lib\index.ts(4,12) + TS1136: Property assignment expected. + @ ./app.ts 3:12-28 \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt new file mode 100644 index 000000000..12b137108 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt @@ -0,0 +1,19 @@ + Asset Size Chunks Chunk Names +bundle.js 4.61 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 131 bytes {main} [built] +[./lib/index.ts] 424 bytes {main} [built] [failed] [1 error] + +ERROR in ./lib/index.ts +Module build failed (from /index.js): +Error: TypeScript emitted no output for lib\index.ts. + at makeSourceMapAndFinish (dist\index.js:45:15) + at successLoader (dist\index.js:36:5) + at Object.loader (dist\index.js:22:12) + @ ./app.ts 3:12-28 + +ERROR in tsconfig.json +[tsl] ERROR + TS6305: Output file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.ts'. + +ERROR in undefined \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/.gitignore b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/.gitignore new file mode 100644 index 000000000..7b7f62099 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/.gitignore @@ -0,0 +1 @@ +!*.js.map \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.ts b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.ts new file mode 100644 index 000000000..f0d02b9e9 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.ts @@ -0,0 +1,5 @@ +export const lib = { + one: 1, + two: 2, + three: 3,, +}; diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/tsconfig.json b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/tsconfig.json new file mode 100644 index 000000000..506c325eb --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/lib/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "composite": true, + "sourceMap": true + }, + "files": [ + "./index.ts" + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/tsconfig.json b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/tsconfig.json new file mode 100644 index 000000000..03974daa7 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/tsconfig.json @@ -0,0 +1,5 @@ +{ + "references": [ + { "path": "./lib" } + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/webpack.config.js b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/webpack.config.js new file mode 100644 index 000000000..0dca2dae2 --- /dev/null +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/webpack.config.js @@ -0,0 +1,19 @@ +var path = require('path') + +module.exports = { + mode: 'development', + entry: './app.ts', + output: { + filename: 'bundle.js' + }, + resolve: { + extensions: ['.ts', '.js'] + }, + module: { + rules: [ + { test: /\.ts$/, loader: 'ts-loader', options: { projectReferences: true } } + ] + } +} + + From 46ce766ee78c3357f8ad5f63fad980eb8e4d6a11 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 16 Sep 2019 13:44:59 -0700 Subject: [PATCH 05/19] Add back the deleted code --- src/after-compile.ts | 16 ++++- src/index.ts | 116 +++++++++++++++++++++++++++----- src/instances.ts | 66 ++++++++++--------- src/utils.ts | 153 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 303 insertions(+), 48 deletions(-) diff --git a/src/after-compile.ts b/src/after-compile.ts index 2da397030..7e431717d 100644 --- a/src/after-compile.ts +++ b/src/after-compile.ts @@ -11,7 +11,12 @@ import { WebpackError, WebpackModule } from './interfaces'; -import { collectAllDependants, ensureProgram, formatErrors } from './utils'; +import { + collectAllDependants, + ensureProgram, + formatErrors, + isUsingProjectReferences +} from './utils'; export function makeAfterCompile( instance: TSInstance, @@ -202,13 +207,20 @@ function provideErrorsToWebpack( // I’m pretty sure this will never be undefined here const program = ensureProgram(instance); - // TODO:: handle referenced projects for (const filePath of filesToCheckForErrors.keys()) { if (filePath.match(filePathRegex) === null) { continue; } 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 + // get a useful error about which file was unexpectedly missing. + if (isUsingProjectReferences(instance) && sourceFile === undefined) { + continue; + } + const errors: ts.Diagnostic[] = []; if (program && sourceFile) { errors.push( diff --git a/src/index.ts b/src/index.ts index ec60cbed2..2c354051e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,7 +16,14 @@ import { TSFile, TSInstance } from './interfaces'; -import { appendSuffixesIfMatch, arrify, formatErrors } from './utils'; +import { + appendSuffixesIfMatch, + arrify, + formatErrors, + getAndCacheOutputJSFileName, + getAndCacheProjectReference, + validateSourceMapOncePerProject +} from './utils'; const webpackInstances: webpack.Compiler[] = []; const loaderOptionsCache: LoaderOptionsCache = {}; @@ -66,20 +73,85 @@ function successLoader( : rawFilePath; const fileVersion = updateFileInCache(options, filePath, contents, instance); - const { outputText, sourceMapText } = options.transpileOnly - ? getTranspilationEmit(filePath, contents, instance, loaderContext) - : getEmit(rawFilePath, filePath, instance, loaderContext); + const referencedProject = getAndCacheProjectReference(filePath, instance); + if (referencedProject !== undefined) { + const [relativeProjectConfigPath, relativeFilePath] = [ + path.relative( + loaderContext.rootContext, + referencedProject.sourceFile.fileName + ), + path.relative(loaderContext.rootContext, filePath) + ]; + if (referencedProject.commandLine.options.outFile !== undefined) { + throw new Error( + `The referenced project at ${relativeProjectConfigPath} is using ` + + `the outFile' option, which is not supported with ts-loader.` + ); + } - makeSourceMapAndFinish( - sourceMapText, - outputText, - filePath, - contents, - loaderContext, - options, - fileVersion, - callback - ); + const jsFileName = getAndCacheOutputJSFileName( + filePath, + referencedProject, + instance + ); + + const relativeJSFileName = path.relative( + loaderContext.rootContext, + jsFileName + ); + if (!instance.compiler.sys.fileExists(jsFileName)) { + throw new Error( + `Could not find output JavaScript file for input ` + + `${relativeFilePath} (looked at ${relativeJSFileName}).\n` + + `The input file is part of a project reference located at ` + + `${relativeProjectConfigPath}, so ts-loader is looking for the ` + + 'project�s pre-built output on disk. Try running `tsc --build` ' + + 'to build project references.' + ); + } + + // Since the output JS file is being read from disk instead of using the + // input TS file, we need to tell the loader that the compilation doesn�t + // actually depend on the current file, but depends on the JS file instead. + loaderContext.clearDependencies(); + loaderContext.addDependency(jsFileName); + + validateSourceMapOncePerProject( + instance, + loaderContext, + jsFileName, + referencedProject + ); + + const mapFileName = jsFileName + '.map'; + const outputText = instance.compiler.sys.readFile(jsFileName); + const sourceMapText = instance.compiler.sys.readFile(mapFileName); + makeSourceMapAndFinish( + sourceMapText, + outputText, + filePath, + contents, + loaderContext, + options, + fileVersion, + callback + ); + } else { + const { outputText, sourceMapText } = options.transpileOnly + ? getTranspilationEmit(filePath, contents, instance, loaderContext) + : getEmit(rawFilePath, filePath, instance, loaderContext); + + makeSourceMapAndFinish( + sourceMapText, + outputText, + filePath, + contents, + loaderContext, + options, + fileVersion, + callback + ); + } } function makeSourceMapAndFinish( @@ -389,7 +461,21 @@ function getEmit( const additionalDependencies = fileDependencies === undefined ? [] - : fileDependencies.map(({ originalFileName }) => originalFileName); + : fileDependencies.map(({ resolvedFileName, originalFileName }) => { + const projectReference = getAndCacheProjectReference( + resolvedFileName, + instance + ); + // In the case of dependencies that are part of a project reference, + // the real dependency that webpack should watch is the JS output file. + return projectReference !== undefined + ? getAndCacheOutputJSFileName( + resolvedFileName, + projectReference, + instance + ) + : originalFileName; + }); if (additionalDependencies.length > 0) { additionalDependencies.forEach(addDependency); diff --git a/src/instances.ts b/src/instances.ts index 0fe13473c..6b5305d26 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -26,6 +26,7 @@ import { appendSuffixesIfMatch, ensureProgram, formatErrors, + isUsingProjectReferences, makeError, supportsSolutionBuild } from './utils'; @@ -499,9 +500,8 @@ function getOutputFilesFromReference( filePath: string ): typescript.OutputFile[] | undefined { // May be api to get file - const refs = - instance.solutionBuilderHost && program.getResolvedProjectReferences(); - return refs && instance.solutionBuilderHost + const refs = program.getResolvedProjectReferences(); + return refs ? forEachResolvedProjectReference(refs, ({ commandLine }) => { const { options, fileNames } = commandLine; if ( @@ -543,37 +543,41 @@ export function getEmitOutput( ) { const program = ensureProgram(instance); if (program !== undefined) { + // TODO:: Unbuilt project reference const sourceFile = program.getSourceFile(filePath); - // The source file will be undefined if it’s part of an unbuilt project reference - if (sourceFile) { - if (path.resolve(sourceFile.fileName) !== path.resolve(filePath)) { - const outputFiles = getOutputFilesFromReference( - program, - instance, - filePath - ); - if (outputFiles) { - return outputFiles; - } - loaderContext.emitWarning(`No output found for ${filePath}`); - } else { - const outputFiles: typescript.OutputFile[] = []; - const writeFile = ( - fileName: string, - text: string, - writeByteOrderMark: boolean - ) => outputFiles.push({ name: fileName, writeByteOrderMark, text }); - program.emit( - sourceFile, - writeFile, - /*cancellationToken*/ undefined, - /*emitOnlyDtsFiles*/ false, - instance.transformers - ); - return outputFiles; + if ( + sourceFile && + instance.solutionBuilderHost && + path.resolve(sourceFile.fileName) !== path.resolve(filePath) + ) { + const builtReferences = getOutputFilesFromReference( + program, + instance, + filePath + ); + if (builtReferences) { + return builtReferences; } + loaderContext.emitWarning(`No output found for ${filePath}`); + return []; + } + const outputFiles: typescript.OutputFile[] = []; + const writeFile = ( + fileName: string, + text: string, + writeByteOrderMark: boolean + ) => outputFiles.push({ name: fileName, writeByteOrderMark, text }); + // The source file will be undefined if it’s part of an unbuilt project reference + if (sourceFile !== undefined || !isUsingProjectReferences(instance)) { + program.emit( + sourceFile, + writeFile, + /*cancellationToken*/ undefined, + /*emitOnlyDtsFiles*/ false, + instance.transformers + ); } - return []; + return outputFiles; } else { // Emit Javascript return instance.languageService!.getProgram()!.getSourceFile(filePath) === diff --git a/src/utils.ts b/src/utils.ts index 8c5e3b3be..b6aa7e407 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -3,6 +3,7 @@ import * as fs from 'fs'; import * as micromatch from 'micromatch'; import * as path from 'path'; import * as typescript from 'typescript'; +import * as webpack from 'webpack'; import constants = require('./constants'); import { @@ -257,9 +258,161 @@ export function ensureProgram(instance: TSInstance) { return instance.program; } +export function supportsProjectReferences(instance: TSInstance) { + const program = ensureProgram(instance); + return program && !!program.getProjectReferences; +} + +export function isUsingProjectReferences(instance: TSInstance) { + if ( + instance.loaderOptions.projectReferences && + supportsProjectReferences(instance) + ) { + const program = ensureProgram(instance); + return Boolean(program && program.getProjectReferences()); + } + return false; +} + +/** + * Gets the project reference for a file from the cache if it exists, + * or gets it from TypeScript and caches it otherwise. + */ +export function getAndCacheProjectReference( + filePath: string, + instance: TSInstance +) { + // When using solution builder, dont do the project reference caching + if (instance.solutionBuilderHost) { + return undefined; + } + + const file = instance.files.get(filePath); + if (file !== undefined && file.projectReference) { + return file.projectReference.project; + } + + const projectReference = getProjectReferenceForFile(filePath, instance); + if (file !== undefined) { + file.projectReference = { project: projectReference }; + } + + return projectReference; +} + +function getResolvedProjectReferences( + program: typescript.Program +): typescript.ResolvedProjectReference[] | undefined { + const getProjectReferences = + (program as any).getResolvedProjectReferences || + program.getProjectReferences; + if (getProjectReferences) { + return getProjectReferences(); + } + return; +} + +function getProjectReferenceForFile(filePath: string, instance: TSInstance) { + if (isUsingProjectReferences(instance)) { + const program = ensureProgram(instance); + return ( + program && + getResolvedProjectReferences(program)!.find( + ref => + (ref && + ref.commandLine.fileNames.some( + file => path.normalize(file) === filePath + )) || + false + ) + ); + } + + return; +} + +export function validateSourceMapOncePerProject( + instance: TSInstance, + loader: webpack.loader.LoaderContext, + jsFileName: string, + project: typescript.ResolvedProjectReference +) { + const { projectsMissingSourceMaps = new Set() } = instance; + if (!projectsMissingSourceMaps.has(project.sourceFile.fileName)) { + instance.projectsMissingSourceMaps = projectsMissingSourceMaps; + projectsMissingSourceMaps.add(project.sourceFile.fileName); + const mapFileName = jsFileName + '.map'; + if (!instance.compiler.sys.fileExists(mapFileName)) { + const [relativeJSPath, relativeProjectConfigPath] = [ + path.relative(loader.rootContext, jsFileName), + path.relative(loader.rootContext, project.sourceFile.fileName) + ]; + loader.emitWarning( + new Error( + 'Could not find source map file for referenced project output ' + + `${relativeJSPath}. Ensure the 'sourceMap' compiler option ` + + `is enabled in ${relativeProjectConfigPath} to ensure Webpack ` + + 'can map project references to the appropriate source files.' + ) + ); + } + } +} + export function supportsSolutionBuild( loaderOptions: LoaderOptions, compiler: typeof typescript ) { return !!loaderOptions.projectReferences && !!compiler.InvalidatedProjectKind; } + +/** + * Gets the output JS file path for an input file governed by a composite project. + * Pulls from the cache if it exists; computes and caches the result otherwise. + */ +export function getAndCacheOutputJSFileName( + inputFileName: string, + projectReference: typescript.ResolvedProjectReference, + instance: TSInstance +) { + const file = instance.files.get(inputFileName); + if (file && file.projectReference && file.projectReference.outputFileName) { + return file.projectReference.outputFileName; + } + + const outputFileName = getOutputJavaScriptFileName( + inputFileName, + projectReference + ); + + if (file !== undefined) { + file.projectReference = file.projectReference || { + project: projectReference + }; + file.projectReference.outputFileName = outputFileName; + } + + return outputFileName; +} + +// Adapted from https://github.com/Microsoft/TypeScript/blob/45101491c0b077c509b25830ef0ee5f85b293754/src/compiler/tsbuild.ts#L305 +function getOutputJavaScriptFileName( + inputFileName: string, + projectReference: typescript.ResolvedProjectReference +) { + const { options } = projectReference.commandLine; + const projectDirectory = + options.rootDir || path.dirname(projectReference.sourceFile.fileName); + const relativePath = path.relative(projectDirectory, inputFileName); + const outputPath = path.resolve( + options.outDir || projectDirectory, + relativePath + ); + const newExtension = constants.jsonRegex.test(inputFileName) + ? '.json' + : constants.tsxRegex.test(inputFileName) && + options.jsx === typescript.JsxEmit.Preserve + ? '.jsx' + : '.js'; + return outputPath.replace(constants.extensionRegex, newExtension); +} From 6c60ab0345f9b6fd0ced53e23faf34d6baa48340 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 16 Sep 2019 14:45:16 -0700 Subject: [PATCH 06/19] More changes to provide correct errors --- src/after-compile.ts | 21 +--- src/instances.ts | 119 +++++++++++------- src/servicesHost.ts | 27 +++- .../expectedOutput-3.6/output.transpiled.txt | 8 +- .../expectedOutput-3.6/bundle.js | 2 +- .../expectedOutput-3.6/output.transpiled.txt | 8 +- .../expectedOutput-3.6/output.txt | 8 +- .../expectedOutput-3.6/bundle.js | 2 +- .../expectedOutput-3.6/output.transpiled.txt | 6 +- .../expectedOutput-3.6/output.txt | 8 +- 10 files changed, 130 insertions(+), 79 deletions(-) diff --git a/src/after-compile.ts b/src/after-compile.ts index 7e431717d..798b8df4a 100644 --- a/src/after-compile.ts +++ b/src/after-compile.ts @@ -11,6 +11,7 @@ import { WebpackError, WebpackModule } from './interfaces'; +import { getSolutionErrors } from './servicesHost'; import { collectAllDependants, ensureProgram, @@ -70,22 +71,10 @@ export function makeAfterCompile( loaderContext ); - if (instance.solutionBuilderHost) { - // append errors - const formattedErrors = instance.solutionBuilderHost.diagnostics.map(d => - formatErrors( - [d], - instance.loaderOptions, - instance.colors, - instance.compiler, - { file: d.file ? path.resolve(d.file.fileName) : 'tsconfig.json' }, - compilation.compiler.context - ) - ); - - compilation.errors.push(...formattedErrors); - } - + // append errors + compilation.errors.push( + ...getSolutionErrors(instance, compilation.compiler.context) + ); instance.filesWithErrors = filesWithErrors; instance.modifiedFiles = null; instance.projectsMissingSourceMaps = new Set(); diff --git a/src/instances.ts b/src/instances.ts index 6b5305d26..06451e318 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -18,6 +18,7 @@ import { } from './interfaces'; import * as logger from './logger'; import { + getSolutionErrors, makeServicesHost, makeSolutionBuilderHost, makeWatchHost @@ -174,20 +175,52 @@ function successfulTypeScriptInstance( getCustomTransformers = customerTransformers; } + // if allowJs is set then we should accept js(x) files + const scriptRegex = + configParseResult.options.allowJs === true + ? /\.tsx?$|\.jsx?$/i + : /\.tsx?$/i; + if (loaderOptions.transpileOnly) { // quick return for transpiling // we do need to check for any issues with TS options though - const program = + const transpileInstance: TSInstance = (instances[loaderOptions.instance] = { + compiler, + compilerOptions, + appendTsTsxSuffixesIfRequired, + loaderOptions, + rootFileNames, + files, + otherFiles, + program: undefined, // temporary, to be set later + dependencyGraph: {}, + reverseDependencyGraph: {}, + transformers: {} as typescript.CustomTransformers, // this is only set temporarily, custom transformers are created further down + colors + }); + + tryAndBuildSolutionReferences( + transpileInstance, + loader, + log, + scriptRegex, + configFilePath + ); + const program = (transpileInstance.program = configParseResult.projectReferences !== undefined ? compiler!.createProgram({ rootNames: configParseResult.fileNames, options: configParseResult.options, projectReferences: configParseResult.projectReferences }) - : compiler!.createProgram([], compilerOptions); + : compiler!.createProgram([], compilerOptions)); // happypack does not have _module.errors - see https://github.com/TypeStrong/ts-loader/issues/336 if (!loaderOptions.happyPackMode) { + const solutionErrors: WebpackError[] = getSolutionErrors( + transpileInstance, + loader.context + ); const diagnostics = program.getOptionsDiagnostics(); const errors = formatErrors( diagnostics, @@ -197,26 +230,10 @@ function successfulTypeScriptInstance( { file: configFilePath || 'tsconfig.json' }, loader.context ); - - loader._module.errors.push(...errors); + loader._module.errors.push(...solutionErrors, ...errors); } - - instances[loaderOptions.instance] = { - compiler, - compilerOptions, - appendTsTsxSuffixesIfRequired, - loaderOptions, - rootFileNames, - files, - otherFiles, - program, - dependencyGraph: {}, - reverseDependencyGraph: {}, - transformers: getCustomTransformers(program), - colors - }; - - return { instance: instances[loaderOptions.instance] }; + transpileInstance.transformers = getCustomTransformers(program); + return { instance: transpileInstance }; } // Load initial files (core lib files, any files specified in tsconfig.json) @@ -246,12 +263,6 @@ function successfulTypeScriptInstance( }; } - // if allowJs is set then we should accept js(x) files - const scriptRegex = - configParseResult.options.allowJs === true - ? /\.tsx?$|\.jsx?$/i - : /\.tsx?$/i; - const instance: TSInstance = (instances[loaderOptions.instance] = { compiler, compilerOptions, @@ -275,23 +286,13 @@ function successfulTypeScriptInstance( ); } - if (configFilePath && supportsSolutionBuild(loaderOptions, compiler)) { - // Use solution builder - log.logInfo('Using SolutionBuilder api'); - instance.configFilePath = configFilePath; - instance.solutionBuilderHost = makeSolutionBuilderHost( - scriptRegex, - log, - loader, - instance - ); - instance.solutionBuilder = compiler.createSolutionBuilderWithWatch( - instance.solutionBuilderHost, - [configFilePath], - { verbose: true, watch: true } - ); - instance.solutionBuilder.buildReferences(instance.configFilePath); - } + tryAndBuildSolutionReferences( + instance, + loader, + log, + scriptRegex, + configFilePath + ); if (loaderOptions.experimentalWatchApi && compiler.createWatchProgram) { log.logInfo('Using watch api'); @@ -344,6 +345,36 @@ function successfulTypeScriptInstance( return { instance }; } + +function tryAndBuildSolutionReferences( + instance: TSInstance, + loader: webpack.loader.LoaderContext, + log: logger.Logger, + scriptRegex: RegExp, + configFilePath: string | undefined +) { + if ( + configFilePath && + supportsSolutionBuild(instance.loaderOptions, instance.compiler) + ) { + // Use solution builder + log.logInfo('Using SolutionBuilder api'); + instance.configFilePath = configFilePath; + instance.solutionBuilderHost = makeSolutionBuilderHost( + scriptRegex, + log, + loader, + instance + ); + instance.solutionBuilder = instance.compiler.createSolutionBuilderWithWatch( + instance.solutionBuilderHost, + [configFilePath], + { verbose: true } + ); + instance.solutionBuilder.buildReferences(instance.configFilePath); + } +} + function forEachResolvedProjectReference( resolvedProjectReferences: | readonly (typescript.ResolvedProjectReference | undefined)[] diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 72def835f..01fed6d23 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -15,11 +15,12 @@ import { TSInstance, WatchCallbacks, WatchFactory, - WatchHost + WatchHost, + WebpackError } from './interfaces'; import * as logger from './logger'; import { makeResolver } from './resolver'; -import { readFile, unorderedRemoveItem } from './utils'; +import { formatErrors, readFile, unorderedRemoveItem } from './utils'; export type Action = () => void; @@ -704,6 +705,28 @@ export function makeSolutionBuilderHost( } } +export function getSolutionErrors(instance: TSInstance, context: string) { + const solutionErrors: WebpackError[] = []; + if ( + instance.solutionBuilderHost && + instance.solutionBuilderHost.diagnostics.length + ) { + instance.solutionBuilderHost.diagnostics.forEach(d => + solutionErrors.push( + ...formatErrors( + [d], + instance.loaderOptions, + instance.colors, + instance.compiler, + { file: d.file ? path.resolve(d.file.fileName) : 'tsconfig.json' }, + context + ) + ) + ); + } + return solutionErrors; +} + type ResolveTypeReferenceDirective = ( directive: string, containingFile: string, diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.transpiled.txt index f557d19c9..d15b24b9a 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.transpiled.txt @@ -1,9 +1,5 @@ Asset Size Chunks Chunk Names bundle.js 4.37 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 183 bytes {main} [built] [1 error] -[./lib/index.ts] 133 bytes {main} [built] - -ERROR in tsconfig.json -[tsl] ERROR - TS6305: Output file '/.test/projectReferencesNotBuilt_ErrorInProject/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_ErrorInProject/lib/index.ts'. \ No newline at end of file +[./app.ts] 183 bytes {main} [built] +[./lib/index.ts] 133 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js index 0d4a06ada..fddc6f2ee 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js @@ -105,7 +105,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /*! no static exports found */ /***/ (function(module, exports) { -eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesNotBuilt_SemanticErrorInReference//lib//index.ts./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:45:15)/n at successLoader (c://github//ts-loader//dist//index.js:36:5)/n at Object.loader (c://github//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesNotBuilt_SemanticErrorInReference//lib//index.ts./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:78:15)/n at successLoader (c://github//ts-loader//dist//index.js:68:9)/n at Object.loader (c://github//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt index f313e931f..ede1a31a4 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt @@ -1,9 +1,13 @@ Asset Size Chunks Chunk Names bundle.js 4.37 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} [built] [1 error] +[./app.ts] 167 bytes {main} [built] [2 errors] [./lib/index.ts] 145 bytes {main} [built] ERROR in tsconfig.json [tsl] ERROR - TS6305: Output file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts'. \ No newline at end of file + TS6305: Output file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts'. + +ERROR in lib\index.ts +[tsl] ERROR in lib\index.ts(6,7) + TS2322: Type '10' is not assignable to type 'string'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt index 44439e40a..45cead617 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt @@ -7,8 +7,8 @@ Entrypoint main = bundle.js ERROR in ./lib/index.ts Module build failed (from /index.js): Error: TypeScript emitted no output for lib\index.ts. - at makeSourceMapAndFinish (dist\index.js:45:15) - at successLoader (dist\index.js:36:5) + at makeSourceMapAndFinish (dist\index.js:78:15) + at successLoader (dist\index.js:68:9) at Object.loader (dist\index.js:22:12) @ ./app.ts 3:12-28 @@ -16,4 +16,6 @@ ERROR in tsconfig.json [tsl] ERROR  TS6305: Output file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts'. -ERROR in undefined \ No newline at end of file +ERROR in lib\index.ts +[tsl] ERROR in lib\index.ts(6,7) + TS2322: Type '10' is not assignable to type 'string'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js index bca6d3c8c..36903e850 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js @@ -105,7 +105,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /*! no static exports found */ /***/ (function(module, exports) { -eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesNotBuilt_SyntaxErrorInReference//lib//index.ts./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:45:15)/n at successLoader (c://github//ts-loader//dist//index.js:36:5)/n at Object.loader (c://github//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesNotBuilt_SyntaxErrorInReference//lib//index.ts./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:78:15)/n at successLoader (c://github//ts-loader//dist//index.js:68:9)/n at Object.loader (c://github//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt index a1ebd4496..5d78d4dd7 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt @@ -1,13 +1,17 @@ Asset Size Chunks Chunk Names bundle.js 4.36 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} [built] [1 error] +[./app.ts] 167 bytes {main} [built] [2 errors] [./lib/index.ts] 134 bytes {main} [built] [1 error] ERROR in tsconfig.json [tsl] ERROR  TS6305: Output file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.ts'. +ERROR in lib\index.ts +[tsl] ERROR in lib\index.ts(4,12) + TS1136: Property assignment expected. + ERROR in lib\index.ts ./lib/index.ts [tsl] ERROR in lib\index.ts(4,12) diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt index 12b137108..b3eb1d18c 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt @@ -7,8 +7,8 @@ Entrypoint main = bundle.js ERROR in ./lib/index.ts Module build failed (from /index.js): Error: TypeScript emitted no output for lib\index.ts. - at makeSourceMapAndFinish (dist\index.js:45:15) - at successLoader (dist\index.js:36:5) + at makeSourceMapAndFinish (dist\index.js:78:15) + at successLoader (dist\index.js:68:9) at Object.loader (dist\index.js:22:12) @ ./app.ts 3:12-28 @@ -16,4 +16,6 @@ ERROR in tsconfig.json [tsl] ERROR  TS6305: Output file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.ts'. -ERROR in undefined \ No newline at end of file +ERROR in lib\index.ts +[tsl] ERROR in lib\index.ts(4,12) + TS1136: Property assignment expected. \ No newline at end of file From 51ee2cf5d12c86dc81bc421bc619a6a31945d30c Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 17 Sep 2019 09:49:01 -0700 Subject: [PATCH 07/19] Update file only if text is different from existing file text and handle watch --- src/instances.ts | 3 +- src/interfaces.ts | 2 +- src/servicesHost.ts | 130 +++++++----------- src/watch-run.ts | 9 +- .../expectedOutput-3.6/bundle.js | 2 +- .../expectedOutput-3.6/bundle.transpiled.js | 2 +- .../expectedOutput-3.6/output.transpiled.txt | 4 +- .../expectedOutput-3.6/output.txt | 7 +- .../expectedOutput-3.6/bundle.js | 2 +- .../expectedOutput-3.6/bundle.transpiled.js | 4 +- .../expectedOutput-3.6/output.transpiled.txt | 11 +- .../expectedOutput-3.6/output.txt | 12 +- .../expectedOutput-3.6/bundle.js | 5 +- .../expectedOutput-3.6/bundle.transpiled.js | 5 +- .../expectedOutput-3.6/output.transpiled.txt | 18 +-- .../expectedOutput-3.6/output.txt | 19 +-- .../expectedOutput-3.6/bundle.transpiled.js | 2 +- .../expectedOutput-3.6/output.transpiled.txt | 4 +- .../expectedOutput-3.6/bundle.js | 2 +- .../expectedOutput-3.6/bundle.transpiled.js | 113 +++++++++++++++ .../expectedOutput-3.6/output.transpiled.txt | 5 + .../expectedOutput-3.6/output.txt | 14 +- 22 files changed, 216 insertions(+), 159 deletions(-) create mode 100644 test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.transpiled.txt diff --git a/src/instances.ts b/src/instances.ts index 06451e318..dd9858e35 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -563,7 +563,7 @@ function getOutputFilesFromReference( export function isReferencedFile(instance: TSInstance, filePath: string) { return ( !!instance.solutionBuilderHost && - !!instance.solutionBuilderHost.watchedFiles[filePath] + !!instance.solutionBuilderHost.watchedFiles.get(filePath) ); } @@ -574,7 +574,6 @@ export function getEmitOutput( ) { const program = ensureProgram(instance); if (program !== undefined) { - // TODO:: Unbuilt project reference const sourceFile = program.getSourceFile(filePath); if ( sourceFile && diff --git a/src/interfaces.ts b/src/interfaces.ts index 7aa20dfb8..dcfd64ddc 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -49,7 +49,7 @@ export interface WatchHost updateRootFileNames(): void; } -export type WatchCallbacks = { [fileName: string]: T[] | undefined }; +export type WatchCallbacks = Map; export interface WatchFactory { watchedFiles: WatchCallbacks; watchedDirectories: WatchCallbacks; diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 01fed6d23..b3147d22d 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -242,14 +242,20 @@ function makeResolvers( }; } -function createWatchFactory(): WatchFactory { - const watchedFiles: WatchCallbacks = {}; +function createWatchFactory( + beforeCallbacks?: ( + cb: typescript.FileWatcherCallback[] | typescript.DirectoryWatcherCallback[] + ) => void +): WatchFactory { + const watchedFiles: WatchCallbacks< + typescript.FileWatcherCallback + > = new Map(); const watchedDirectories: WatchCallbacks< typescript.DirectoryWatcherCallback - > = {}; + > = new Map(); const watchedDirectoriesRecursive: WatchCallbacks< typescript.DirectoryWatcherCallback - > = {}; + > = new Map(); return { watchedFiles, @@ -278,10 +284,13 @@ function createWatchFactory(): WatchFactory { fileName: string, eventKind?: typescript.FileWatcherEventKind ) { - if (callbacks !== undefined) { + if (callbacks !== undefined && callbacks.length) { // The array copy is made to ensure that even if one of the callback removes the callbacks, // we dont miss any callbacks following it const cbs = callbacks.slice(); + if (beforeCallbacks) { + beforeCallbacks(cbs); + } for (const cb of cbs) { cb(fileName, eventKind as typescript.FileWatcherEventKind); } @@ -293,7 +302,7 @@ function createWatchFactory(): WatchFactory { eventKind: typescript.FileWatcherEventKind ) { fileName = path.normalize(fileName); - invokeWatcherCallbacks(watchedFiles[fileName], fileName, eventKind); + invokeWatcherCallbacks(watchedFiles.get(fileName), fileName, eventKind); } function invokeDirectoryWatcher( @@ -301,7 +310,10 @@ function createWatchFactory(): WatchFactory { fileAddedOrRemoved: string ) { directory = path.normalize(directory); - invokeWatcherCallbacks(watchedDirectories[directory], fileAddedOrRemoved); + invokeWatcherCallbacks( + watchedDirectories.get(directory), + fileAddedOrRemoved + ); invokeRecursiveDirectoryWatcher(directory, fileAddedOrRemoved); } @@ -311,7 +323,7 @@ function createWatchFactory(): WatchFactory { ) { directory = path.normalize(directory); invokeWatcherCallbacks( - watchedDirectoriesRecursive[directory], + watchedDirectoriesRecursive.get(directory), fileAddedOrRemoved ); const basePath = path.dirname(directory); @@ -326,18 +338,21 @@ function createWatchFactory(): WatchFactory { callback: T ): typescript.FileWatcher { file = path.normalize(file); - const existing = callbacks[file]; + const existing = callbacks.get(file); if (existing === undefined) { - callbacks[file] = [callback]; + callbacks.set(file, [callback]); } else { existing.push(callback); } return { close: () => { // tslint:disable-next-line:no-shadowed-variable - const existing = callbacks[file]; + const existing = callbacks.get(file); if (existing !== undefined) { unorderedRemoveItem(existing, callback); + if (!existing.length) { + callbacks.delete(file); + } } } }; @@ -373,21 +388,24 @@ export function updateFileWithText( const file = instance.files.get(nFilePath) || instance.otherFiles.get(nFilePath); if (file !== undefined) { - file.text = text(nFilePath); - file.version++; - instance.version!++; - instance.modifiedFiles!.set(nFilePath, file); - if (instance.watchHost !== undefined) { - instance.watchHost.invokeFileWatcher( - nFilePath, - instance.compiler.FileWatcherEventKind.Changed - ); - } - if (instance.solutionBuilderHost !== undefined) { - instance.solutionBuilderHost.invokeFileWatcher( - nFilePath, - instance.compiler.FileWatcherEventKind.Changed - ); + const newText = text(nFilePath); + if (newText !== file.text) { + file.text = newText; + file.version++; + instance.version!++; + instance.modifiedFiles!.set(nFilePath, file); + if (instance.watchHost !== undefined) { + instance.watchHost.invokeFileWatcher( + nFilePath, + instance.compiler.FileWatcherEventKind.Changed + ); + } + if (instance.solutionBuilderHost !== undefined) { + instance.solutionBuilderHost.invokeFileWatcher( + nFilePath, + instance.compiler.FileWatcherEventKind.Changed + ); + } } } } @@ -593,13 +611,6 @@ export function makeSolutionBuilderHost( log.logInfo(compiler.formatDiagnostic(d, formatDiagnosticHost)); }; - const { - watchFile, - watchDirectory, - watchedFiles, - ...rest - } = createWatchFactory(); - const reportSolutionBuilderStatus = (d: typescript.Diagnostic) => log.logInfo(compiler.formatDiagnostic(d, formatDiagnosticHost)); const reportWatchStatus = ( @@ -622,10 +633,7 @@ export function makeSolutionBuilderHost( reportWatchStatus ), diagnostics: [], - watchFile: builderWatchFile, - watchDirectory, - watchedFiles, - ...rest + ...createWatchFactory(beforeWatchCallbacks) }; solutionBuilderHost.getCurrentDirectory = getCurrentDirectory; solutionBuilderHost.trace = logData => log.logInfo(logData); @@ -656,52 +664,8 @@ export function makeSolutionBuilderHost( return solutionBuilderHost; - function builderWatchFile( - fileName: string, - callback: typescript.FileWatcherCallback, - pollingInterval?: number - ) { - loader.addDependency(path.resolve(fileName)); - const watcher = watchFile(fileName, callback, pollingInterval); - return { - close() { - watcher.close(); - updateDependencies(); - } - }; - } - - // TODO:: - // function builderWatchDirectory(path: string, callback: typescript.DirectoryWatcherCallback, recursive?: boolean) { - // loader.addContextDependency(path); - // const watcher = watchDirectory(path, callback, recursive); - // return { - // close() { - // watcher.close(); - // updateDependencies(); - // } - // }; - // } - - function updateDependencies() { - loader.clearDependencies(); - for (const key in watchedFiles) { - if (Object.prototype.hasOwnProperty.call(watchedFiles, key)) { - loader.addDependency(key); - } - } - - // TODO:: - // for (const key in watchedDirectories) { - // if (Object.prototype.hasOwnProperty.call(watchedDirectories, key)) { - // loader.addContextDependency(key); - // } - // } - // for (const key in watchedDirectoriesRecursive) { - // if (Object.prototype.hasOwnProperty.call(watchedDirectoriesRecursive, key)) { - // loader.addContextDependency(key); - // } - // } + function beforeWatchCallbacks() { + solutionBuilderHost.diagnostics.length = 0; } } diff --git a/src/watch-run.ts b/src/watch-run.ts index 2e8664474..cb773814f 100644 --- a/src/watch-run.ts +++ b/src/watch-run.ts @@ -18,7 +18,6 @@ export function makeWatchRun(instance: TSInstance) { instance.modifiedFiles = new Map(); } - // startTime = startTime || watching.startTime; const times = compiler.fileTimestamps; for (const [filePath, date] of times) { if ( @@ -29,7 +28,6 @@ export function makeWatchRun(instance: TSInstance) { } lastTimes.set(filePath, date); - updateFile(instance, filePath); } @@ -44,6 +42,13 @@ export function makeWatchRun(instance: TSInstance) { } } + // Update all the watched files from solution builder + if (instance.solutionBuilderHost) { + for (const filePath of instance.solutionBuilderHost.watchedFiles.keys()) { + updateFile(instance, filePath); + } + } + callback(); }; } diff --git a/test/comparison-tests/projectReferences/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferences/expectedOutput-3.6/bundle.js index 715c05596..7b491a754 100644 --- a/test/comparison-tests/projectReferences/expectedOutput-3.6/bundle.js +++ b/test/comparison-tests/projectReferences/expectedOutput-3.6/bundle.js @@ -106,7 +106,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nexports.__esModule = true;\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n // I am adding this comment here by hand to ensure\n // Webpack is using the JS output for project references\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferences/expectedOutput-3.6/bundle.transpiled.js b/test/comparison-tests/projectReferences/expectedOutput-3.6/bundle.transpiled.js index 31bfda904..a59c4688b 100644 --- a/test/comparison-tests/projectReferences/expectedOutput-3.6/bundle.transpiled.js +++ b/test/comparison-tests/projectReferences/expectedOutput-3.6/bundle.transpiled.js @@ -106,7 +106,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar li /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nexports.__esModule = true;\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n // I am adding this comment here by hand to ensure\n // Webpack is using the JS output for project references\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferences/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferences/expectedOutput-3.6/output.transpiled.txt index 0de20a80c..f31c64018 100644 --- a/test/comparison-tests/projectReferences/expectedOutput-3.6/output.transpiled.txt +++ b/test/comparison-tests/projectReferences/expectedOutput-3.6/output.transpiled.txt @@ -1,5 +1,5 @@ Asset Size Chunks Chunk Names -bundle.js 4.43 KiB main [emitted] main +bundle.js 4.35 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 167 bytes {main} [built] -[./lib/index.ts] 213 bytes {main} [built] \ No newline at end of file +[./lib/index.ts] 133 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferences/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferences/expectedOutput-3.6/output.txt index 678bcdcab..2e1ef6d64 100644 --- a/test/comparison-tests/projectReferences/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferences/expectedOutput-3.6/output.txt @@ -1,5 +1,6 @@ - Asset Size Chunks Chunk Names -bundle.js 4.4 KiB main [emitted] main + Asset Size Chunks Chunk Names + bundle.js 4.29 KiB main [emitted] main +../lib/index.d.ts 89 bytes [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/index.ts] 213 bytes {main} [built] \ No newline at end of file +[./lib/index.ts] 104 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.js index 7c5f9bb80..d5bd6d537 100644 --- a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.js +++ b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.js @@ -118,7 +118,7 @@ eval("\nexports.__esModule = true;\nexports.foo = 'foo';\n\n\n//# sourceURL=webp /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nexports.__esModule = true;\nvar foo_1 = __webpack_require__(/*! ./foo */ \"./lib/foo.ts\");\nexports.lib = {\n one: 1,\n two: 2,\n three: 3,\n foo: foo_1.foo\n // I am adding this comment here by hand to ensure\n // Webpack is using the JS output for project references\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("\r\nexports.__esModule = true;\r\nvar foo_1 = __webpack_require__(/*! ./foo */ \"./lib/foo.ts\");\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3,\r\n foo: foo_1.foo\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.transpiled.js b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.transpiled.js index 91edc1056..a5f3848a9 100644 --- a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.transpiled.js +++ b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.transpiled.js @@ -106,7 +106,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar li /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nexports.__esModule = true;\nexports.foo = 'foo';\n\n\n//# sourceURL=webpack:///./lib/foo.ts?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.foo = 'foo';\n\n\n//# sourceURL=webpack:///./lib/foo.ts?"); /***/ }), @@ -118,7 +118,7 @@ eval("\nexports.__esModule = true;\nexports.foo = 'foo';\n\n\n//# sourceURL=webp /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nexports.__esModule = true;\nvar foo_1 = __webpack_require__(/*! ./foo */ \"./lib/foo.ts\");\nexports.lib = {\n one: 1,\n two: 2,\n three: 3,\n foo: foo_1.foo\n // I am adding this comment here by hand to ensure\n // Webpack is using the JS output for project references\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar foo_1 = __webpack_require__(/*! ./foo */ \"./lib/foo.ts\");\nexports.lib = {\n one: 1,\n two: 2,\n three: 3,\n foo: foo_1.foo\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.transpiled.txt index 56302102b..f24a8ccf2 100644 --- a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.transpiled.txt @@ -1,11 +1,6 @@ Asset Size Chunks Chunk Names -bundle.js 4.83 KiB main [emitted] main +bundle.js 4.79 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 167 bytes {main} [built] -[./lib/foo.ts] 62 bytes {main} [built] -[./lib/index.ts] 263 bytes {main} [built] [1 warning] - -WARNING in ./lib/index.ts -Module Warning (from /index.js): -Could not find source map file for referenced project output lib\index.js. Ensure the 'sourceMap' compiler option is enabled in lib\tsconfig.json to ensure Webpack can map project references to the appropriate source files. - @ ./app.ts 3:12-28 \ No newline at end of file +[./lib/foo.ts] 98 bytes {main} [built] +[./lib/index.ts] 183 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt index 3b520c332..07ee1543f 100644 --- a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt @@ -1,11 +1,7 @@ - Asset Size Chunks Chunk Names -bundle.js 4.79 KiB main [emitted] main + Asset Size Chunks Chunk Names + bundle.js 4.69 KiB main [emitted] main +../lib/index.d.ts 107 bytes [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] [./lib/foo.ts] 62 bytes {main} [built] -[./lib/index.ts] 263 bytes {main} [built] [1 warning] - -WARNING in ./lib/index.ts -Module Warning (from /index.js): -Could not find source map file for referenced project output lib\index.js. Ensure the 'sourceMap' compiler option is enabled in lib\tsconfig.json to ensure Webpack can map project references to the appropriate source files. - @ ./app.ts 3:12-28 \ No newline at end of file +[./lib/index.ts] 156 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/bundle.js index 427a6d198..7b491a754 100644 --- a/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/bundle.js +++ b/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/bundle.js @@ -103,9 +103,10 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ !*** ./lib/index.ts ***! \**********************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("throw new Error(\"Module build failed (from C:/source/ts-loader/index.js):/nError: Could not find output JavaScript file for input lib//index.ts (looked at lib//index.js)./nThe input file is part of a project reference located at lib//tsconfig.json, so ts-loader is looking for the project’s pre-built output on disk. Try running `tsc --build` to build project references./n at successLoader (C://source//ts-loader//dist//index.js:46:19)/n at Object.loader (C://source//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/bundle.transpiled.js b/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/bundle.transpiled.js index 4931ce5cd..a59c4688b 100644 --- a/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/bundle.transpiled.js +++ b/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/bundle.transpiled.js @@ -103,9 +103,10 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar li !*** ./lib/index.ts ***! \**********************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("throw new Error(\"Module build failed (from C:/source/ts-loader/index.js):/nError: Could not find output JavaScript file for input lib//index.ts (looked at lib//index.js)./nThe input file is part of a project reference located at lib//tsconfig.json, so ts-loader is looking for the project’s pre-built output on disk. Try running `tsc --build` to build project references./n at successLoader (C://source//ts-loader//dist//index.js:46:19)/n at Object.loader (C://source//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.transpiled.txt index 2d644da17..f31c64018 100644 --- a/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.transpiled.txt @@ -1,17 +1,5 @@ Asset Size Chunks Chunk Names -bundle.js 4.72 KiB main [emitted] main +bundle.js 4.35 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} [built] [1 error] -[./lib/index.ts] 510 bytes {main} [built] [failed] [1 error] - -ERROR in tsconfig.json -[tsl] ERROR - TS6305: Output file '/.test/projectReferencesNotBuilt/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt/lib/index.ts'. - -ERROR in ./lib/index.ts -Module build failed (from /index.js): -Error: Could not find output JavaScript file for input lib\index.ts (looked at lib\index.js). -The input file is part of a project reference located at lib\tsconfig.json, so ts-loader is looking for the project’s pre-built output on disk. Try running `tsc --build` to build project references. - at successLoader (dist\index.js:46:19) - at Object.loader (dist\index.js:22:12) - @ ./app.ts 3:12-28 \ No newline at end of file +[./app.ts] 167 bytes {main} [built] +[./lib/index.ts] 133 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.txt index 947affc5e..2e1ef6d64 100644 --- a/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.txt @@ -1,17 +1,6 @@ - Asset Size Chunks Chunk Names -bundle.js 4.68 KiB main [emitted] main + Asset Size Chunks Chunk Names + bundle.js 4.29 KiB main [emitted] main +../lib/index.d.ts 89 bytes [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/index.ts] 510 bytes {main} [built] [failed] [1 error] - -ERROR in ./lib/index.ts -Module build failed (from /index.js): -Error: Could not find output JavaScript file for input lib\index.ts (looked at lib\index.js). -The input file is part of a project reference located at lib\tsconfig.json, so ts-loader is looking for the project’s pre-built output on disk. Try running `tsc --build` to build project references. - at successLoader (dist\index.js:46:19) - at Object.loader (dist\index.js:22:12) - @ ./app.ts 3:12-28 - -ERROR in tsconfig.json -[tsl] ERROR - TS6305: Output file '/.test/projectReferencesNotBuilt/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt/lib/index.ts'. \ No newline at end of file +[./lib/index.ts] 104 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesOutDir/expectedOutput-3.6/bundle.transpiled.js b/test/comparison-tests/projectReferencesOutDir/expectedOutput-3.6/bundle.transpiled.js index 3e1b97b44..a59c4688b 100644 --- a/test/comparison-tests/projectReferencesOutDir/expectedOutput-3.6/bundle.transpiled.js +++ b/test/comparison-tests/projectReferencesOutDir/expectedOutput-3.6/bundle.transpiled.js @@ -106,7 +106,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar li /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nexports.__esModule = true;\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesOutDir/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesOutDir/expectedOutput-3.6/output.transpiled.txt index aa97fd4e9..f31c64018 100644 --- a/test/comparison-tests/projectReferencesOutDir/expectedOutput-3.6/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesOutDir/expectedOutput-3.6/output.transpiled.txt @@ -1,5 +1,5 @@ Asset Size Chunks Chunk Names -bundle.js 4.32 KiB main [emitted] main +bundle.js 4.35 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 167 bytes {main} [built] -[./lib/index.ts] 97 bytes {main} [built] \ No newline at end of file +[./lib/index.ts] 133 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/bundle.js index 5b92811cd..562a533e8 100644 --- a/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/bundle.js +++ b/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/bundle.js @@ -106,7 +106,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _lib /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lib\", function() { return lib; });\nconst lib = {\n one: 1,\n two: 2,\n three: 3\n};\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./lib/src/index.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lib\", function() { return lib; });\nconst lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/src/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/bundle.transpiled.js b/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/bundle.transpiled.js new file mode 100644 index 000000000..4cd40bf50 --- /dev/null +++ b/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/bundle.transpiled.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _lib_src_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/src/index */ \"./lib/src/index.ts\");\n\nconsole.log(_lib_src_index__WEBPACK_IMPORTED_MODULE_0__[\"lib\"].one, _lib_src_index__WEBPACK_IMPORTED_MODULE_0__[\"lib\"].two, _lib_src_index__WEBPACK_IMPORTED_MODULE_0__[\"lib\"].three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/src/index.ts": +/*!**************************!*\ + !*** ./lib/src/index.ts ***! + \**************************/ +/*! exports provided: lib */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lib\", function() { return lib; });\nconst lib = {\n one: 1,\n two: 2,\n three: 3\n};\n\n\n//# sourceURL=webpack:///./lib/src/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.transpiled.txt new file mode 100644 index 000000000..fa144b2cd --- /dev/null +++ b/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.transpiled.txt @@ -0,0 +1,5 @@ + Asset Size Chunks Chunk Names +bundle.js 4.65 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 81 bytes {main} [built] +[./lib/src/index.ts] 61 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.txt index a4653b242..ee8c2f922 100644 --- a/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.txt @@ -1,10 +1,10 @@ - Asset Size Chunks Chunk Names -bundle.js 4.69 KiB main [emitted] main + Asset Size Chunks Chunk Names + bundle.js 4.66 KiB main [emitted] main +../lib/out/index.d.ts 89 bytes [emitted] Entrypoint main = bundle.js [./app.ts] 81 bytes {main} [built] -[./lib/src/index.ts] 94 bytes {main} [built] [1 warning] +[./lib/src/index.ts] 66 bytes {main} [built] -WARNING in ./lib/src/index.ts -Module Warning (from /index.js): -Could not find source map file for referenced project output lib\out\index.js. Ensure the 'sourceMap' compiler option is enabled in lib\tsconfig.json to ensure Webpack can map project references to the appropriate source files. - @ ./app.ts 1:0-38 2:12-15 2:21-24 2:30-33 \ No newline at end of file +ERROR in tsconfig.json +[tsl] ERROR + TS5033: Could not write file '/.test/projectReferencesRootDir/lib/out/index.d.ts': Cannot read property 'set' of null. \ No newline at end of file From c0df0e8ed3f72fd95dff96d6e7e472f0c0bf5323 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 17 Sep 2019 12:54:38 -0700 Subject: [PATCH 08/19] Update index.ts --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 2c354051e..29f32ff42 100644 --- a/src/index.ts +++ b/src/index.ts @@ -105,7 +105,7 @@ function successLoader( `${relativeFilePath} (looked at ${relativeJSFileName}).\n` + `The input file is part of a project reference located at ` + `${relativeProjectConfigPath}, so ts-loader is looking for the ` + - 'project�s pre-built output on disk. Try running `tsc --build` ' + + 'project’s pre-built output on disk. Try running `tsc --build` ' + 'to build project references.' ); } From 470a9de2ce4a445884789c69e81ca32135cb99d0 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 17 Sep 2019 12:55:09 -0700 Subject: [PATCH 09/19] Update index.ts --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 29f32ff42..7288f4af5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -111,7 +111,7 @@ function successLoader( } // Since the output JS file is being read from disk instead of using the - // input TS file, we need to tell the loader that the compilation doesn�t + // input TS file, we need to tell the loader that the compilation doesn’t // actually depend on the current file, but depends on the JS file instead. loaderContext.clearDependencies(); loaderContext.addDependency(jsFileName); From 22a94d212bc999304840ca0f2024279787d806de Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 17 Sep 2019 13:34:26 -0700 Subject: [PATCH 10/19] Remove error duplication in case of syntax errors --- src/index.ts | 5 ++++- src/servicesHost.ts | 2 +- .../expectedOutput-3.6/output.transpiled.txt | 13 +++---------- .../expectedOutput-3.6/output.txt | 3 +-- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7288f4af5..d0a6a723a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -526,7 +526,10 @@ function getTranspilationEmit( }); // _module.errors is not available inside happypack - see https://github.com/TypeStrong/ts-loader/issues/336 - if (!instance.loaderOptions.happyPackMode) { + if ( + !instance.loaderOptions.happyPackMode && + !isReferencedFile(instance, fileName) + ) { const errors = formatErrors( diagnostics, instance.loaderOptions, diff --git a/src/servicesHost.ts b/src/servicesHost.ts index b3147d22d..60cab271e 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -682,7 +682,7 @@ export function getSolutionErrors(instance: TSInstance, context: string) { instance.loaderOptions, instance.colors, instance.compiler, - { file: d.file ? path.resolve(d.file.fileName) : 'tsconfig.json' }, + { file: d.file ? undefined : 'tsconfig.json' }, context ) ) diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt index 5d78d4dd7..6475f5a18 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.transpiled.txt @@ -2,18 +2,11 @@ bundle.js 4.36 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 167 bytes {main} [built] [2 errors] -[./lib/index.ts] 134 bytes {main} [built] [1 error] +[./lib/index.ts] 134 bytes {main} [built] ERROR in tsconfig.json [tsl] ERROR  TS6305: Output file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.ts'. -ERROR in lib\index.ts -[tsl] ERROR in lib\index.ts(4,12) - TS1136: Property assignment expected. - -ERROR in lib\index.ts -./lib/index.ts -[tsl] ERROR in lib\index.ts(4,12) - TS1136: Property assignment expected. - @ ./app.ts 3:12-28 \ No newline at end of file +ERROR in [tsl] ERROR in lib\index.ts(4,12) + TS1136: Property assignment expected. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt index b3eb1d18c..6acd185d7 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt @@ -16,6 +16,5 @@ ERROR in tsconfig.json [tsl] ERROR  TS6305: Output file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.ts'. -ERROR in lib\index.ts -[tsl] ERROR in lib\index.ts(4,12) +ERROR in [tsl] ERROR in lib\index.ts(4,12)  TS1136: Property assignment expected. \ No newline at end of file From f418dd7577eae08e47702129a7b42eefd69fee14 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 17 Sep 2019 13:42:40 -0700 Subject: [PATCH 11/19] Add test for watch --- .../projectReferencesWatch/app.ts | 3 + .../expectedOutput-3.6/bundle.js | 113 ++++++++++++++++++ .../expectedOutput-3.6/bundle.transpiled.js | 113 ++++++++++++++++++ .../expectedOutput-3.6/output.transpiled.txt | 5 + .../expectedOutput-3.6/output.txt | 6 + .../expectedOutput-3.6/patch0/bundle.js | 113 ++++++++++++++++++ .../patch0/bundle.transpiled.js | 113 ++++++++++++++++++ .../patch0/output.transpiled.txt | 5 + .../expectedOutput-3.6/patch0/output.txt | 6 + .../expectedOutput-3.6/patch1/bundle.js | 113 ++++++++++++++++++ .../patch1/bundle.transpiled.js | 113 ++++++++++++++++++ .../patch1/output.transpiled.txt | 5 + .../expectedOutput-3.6/patch1/output.txt | 10 ++ .../expectedOutput-3.6/patch2/bundle.js | 113 ++++++++++++++++++ .../patch2/bundle.transpiled.js | 113 ++++++++++++++++++ .../patch2/output.transpiled.txt | 5 + .../expectedOutput-3.6/patch2/output.txt | 11 ++ .../expectedOutput-3.6/patch3/bundle.js | 113 ++++++++++++++++++ .../patch3/bundle.transpiled.js | 113 ++++++++++++++++++ .../patch3/output.transpiled.txt | 5 + .../expectedOutput-3.6/patch3/output.txt | 11 ++ .../expectedOutput-3.6/patch4/bundle.js | 113 ++++++++++++++++++ .../patch4/bundle.transpiled.js | 113 ++++++++++++++++++ .../patch4/output.transpiled.txt | 5 + .../expectedOutput-3.6/patch4/output.txt | 15 +++ .../expectedOutput-3.6/patch5/bundle.js | 113 ++++++++++++++++++ .../patch5/bundle.transpiled.js | 113 ++++++++++++++++++ .../patch5/output.transpiled.txt | 5 + .../expectedOutput-3.6/patch5/output.txt | 15 +++ .../projectReferencesWatch/lib/.gitignore | 1 + .../projectReferencesWatch/lib/index.ts | 5 + .../projectReferencesWatch/lib/tsconfig.json | 9 ++ .../patch0/lib/index.ts | 6 + .../projectReferencesWatch/patch1/app.ts | 3 + .../patch2/lib/index.ts | 7 ++ .../patch3/lib/index.ts | 7 ++ .../projectReferencesWatch/patch4/app.ts | 3 + .../projectReferencesWatch/patch5/app.ts | 3 + .../projectReferencesWatch/tsconfig.json | 8 ++ .../projectReferencesWatch/webpack.config.js | 20 ++++ 40 files changed, 1766 insertions(+) create mode 100644 test/comparison-tests/projectReferencesWatch/app.ts create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt create mode 100644 test/comparison-tests/projectReferencesWatch/lib/.gitignore create mode 100644 test/comparison-tests/projectReferencesWatch/lib/index.ts create mode 100644 test/comparison-tests/projectReferencesWatch/lib/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesWatch/patch0/lib/index.ts create mode 100644 test/comparison-tests/projectReferencesWatch/patch1/app.ts create mode 100644 test/comparison-tests/projectReferencesWatch/patch2/lib/index.ts create mode 100644 test/comparison-tests/projectReferencesWatch/patch3/lib/index.ts create mode 100644 test/comparison-tests/projectReferencesWatch/patch4/app.ts create mode 100644 test/comparison-tests/projectReferencesWatch/patch5/app.ts create mode 100644 test/comparison-tests/projectReferencesWatch/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesWatch/webpack.config.js diff --git a/test/comparison-tests/projectReferencesWatch/app.ts b/test/comparison-tests/projectReferencesWatch/app.ts new file mode 100644 index 000000000..a83f2065b --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/app.ts @@ -0,0 +1,3 @@ +import { lib } from './lib'; + +console.log(lib.one, lib.two, lib.three); diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/bundle.js new file mode 100644 index 000000000..7b491a754 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/bundle.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/bundle.transpiled.js new file mode 100644 index 000000000..a59c4688b --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/bundle.transpiled.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.transpiled.txt new file mode 100644 index 000000000..f31c64018 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.transpiled.txt @@ -0,0 +1,5 @@ + Asset Size Chunks Chunk Names +bundle.js 4.35 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 167 bytes {main} [built] +[./lib/index.ts] 133 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.txt new file mode 100644 index 000000000..2e1ef6d64 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.txt @@ -0,0 +1,6 @@ + Asset Size Chunks Chunk Names + bundle.js 4.29 KiB main [emitted] main +../lib/index.d.ts 89 bytes [emitted] +Entrypoint main = bundle.js +[./app.ts] 131 bytes {main} [built] +[./lib/index.ts] 104 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.js new file mode 100644 index 000000000..7b491a754 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.transpiled.js new file mode 100644 index 000000000..b8a11c082 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.transpiled.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3,\n four: 4 // Add new number\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.transpiled.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.transpiled.txt new file mode 100644 index 000000000..5bdc311de --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.transpiled.txt @@ -0,0 +1,5 @@ + Asset Size Chunks Chunk Names +bundle.js 4.39 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 167 bytes {main} +[./lib/index.ts] 164 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt new file mode 100644 index 000000000..2e1ef6d64 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt @@ -0,0 +1,6 @@ + Asset Size Chunks Chunk Names + bundle.js 4.29 KiB main [emitted] main +../lib/index.d.ts 89 bytes [emitted] +Entrypoint main = bundle.js +[./app.ts] 131 bytes {main} [built] +[./lib/index.ts] 104 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.js new file mode 100644 index 000000000..303a19052 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.transpiled.js new file mode 100644 index 000000000..4bfa7680a --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.transpiled.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3,\n four: 4 // Add new number\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.transpiled.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.transpiled.txt new file mode 100644 index 000000000..055ff64ce --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.transpiled.txt @@ -0,0 +1,5 @@ + Asset Size Chunks Chunk Names +bundle.js 4.42 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 205 bytes {main} [built] +[./lib/index.ts] 164 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt new file mode 100644 index 000000000..802a2b971 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt @@ -0,0 +1,10 @@ + Asset Size Chunks Chunk Names +bundle.js 4.33 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 169 bytes {main} [built] [1 error] +[./lib/index.ts] 104 bytes {main} + +ERROR in app.ts +./app.ts +[tsl] ERROR in app.ts(3,46) + TS2339: Property 'four' does not exist on type '{ one: number; two: number; three: number; }'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.js new file mode 100644 index 000000000..303a19052 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.transpiled.js new file mode 100644 index 000000000..3ce80b633 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.transpiled.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3,\n four: 4,\n} // Add new number\n;\n;\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.transpiled.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.transpiled.txt new file mode 100644 index 000000000..df2b4fb68 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.transpiled.txt @@ -0,0 +1,5 @@ + Asset Size Chunks Chunk Names +bundle.js 4.43 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 205 bytes {main} +[./lib/index.ts] 168 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt new file mode 100644 index 000000000..09ae91602 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt @@ -0,0 +1,11 @@ + Asset Size Chunks Chunk Names + bundle.js 4.33 KiB main [emitted] main +../lib/index.d.ts 89 bytes [emitted] +Entrypoint main = bundle.js +[./app.ts] 169 bytes {main} [built] [1 error] +[./lib/index.ts] 104 bytes {main} [built] + +ERROR in app.ts +./app.ts +[tsl] ERROR in app.ts(3,46) + TS2339: Property 'four' does not exist on type '{ one: number; two: number; three: number; }'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.js new file mode 100644 index 000000000..303a19052 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.transpiled.js new file mode 100644 index 000000000..dd7a8066e --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.transpiled.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3,\n four: 4,\n five: 5,\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.transpiled.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.transpiled.txt new file mode 100644 index 000000000..2c28f842b --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.transpiled.txt @@ -0,0 +1,5 @@ + Asset Size Chunks Chunk Names +bundle.js 4.42 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 205 bytes {main} +[./lib/index.ts] 160 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt new file mode 100644 index 000000000..09ae91602 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt @@ -0,0 +1,11 @@ + Asset Size Chunks Chunk Names + bundle.js 4.33 KiB main [emitted] main +../lib/index.d.ts 89 bytes [emitted] +Entrypoint main = bundle.js +[./app.ts] 169 bytes {main} [built] [1 error] +[./lib/index.ts] 104 bytes {main} [built] + +ERROR in app.ts +./app.ts +[tsl] ERROR in app.ts(3,46) + TS2339: Property 'four' does not exist on type '{ one: number; two: number; three: number; }'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.js new file mode 100644 index 000000000..6bb011ea7 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four, lib_1.lib.ffive); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.transpiled.js new file mode 100644 index 000000000..160d4488f --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.transpiled.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four, lib_1.lib.ffive); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3,\n four: 4,\n five: 5,\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.transpiled.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.transpiled.txt new file mode 100644 index 000000000..a866098ce --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.transpiled.txt @@ -0,0 +1,5 @@ + Asset Size Chunks Chunk Names +bundle.js 4.44 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 222 bytes {main} [built] +[./lib/index.ts] 160 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt new file mode 100644 index 000000000..3393baeab --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt @@ -0,0 +1,15 @@ + Asset Size Chunks Chunk Names +bundle.js 4.35 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 186 bytes {main} [built] [2 errors] +[./lib/index.ts] 104 bytes {main} + +ERROR in app.ts +./app.ts +[tsl] ERROR in app.ts(3,46) + TS2339: Property 'four' does not exist on type '{ one: number; two: number; three: number; }'. + +ERROR in app.ts +./app.ts +[tsl] ERROR in app.ts(3,56) + TS2339: Property 'ffive' does not exist on type '{ one: number; two: number; three: number; }'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.js new file mode 100644 index 000000000..6b0cde9cc --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four, lib_1.lib.five); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.transpiled.js new file mode 100644 index 000000000..9a42c42f7 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.transpiled.js @@ -0,0 +1,113 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, lib_1.lib.four, lib_1.lib.five); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3,\n four: 4,\n five: 5,\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.transpiled.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.transpiled.txt new file mode 100644 index 000000000..dd53f5541 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.transpiled.txt @@ -0,0 +1,5 @@ + Asset Size Chunks Chunk Names +bundle.js 4.44 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 221 bytes {main} [built] +[./lib/index.ts] 160 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt new file mode 100644 index 000000000..0ff3471ad --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt @@ -0,0 +1,15 @@ + Asset Size Chunks Chunk Names +bundle.js 4.35 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 185 bytes {main} [built] [2 errors] +[./lib/index.ts] 104 bytes {main} + +ERROR in app.ts +./app.ts +[tsl] ERROR in app.ts(3,46) + TS2339: Property 'four' does not exist on type '{ one: number; two: number; three: number; }'. + +ERROR in app.ts +./app.ts +[tsl] ERROR in app.ts(3,56) + TS2339: Property 'five' does not exist on type '{ one: number; two: number; three: number; }'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/lib/.gitignore b/test/comparison-tests/projectReferencesWatch/lib/.gitignore new file mode 100644 index 000000000..7b7f62099 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/lib/.gitignore @@ -0,0 +1 @@ +!*.js.map \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/lib/index.ts b/test/comparison-tests/projectReferencesWatch/lib/index.ts new file mode 100644 index 000000000..669ca7b3d --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/lib/index.ts @@ -0,0 +1,5 @@ +export const lib = { + one: 1, + two: 2, + three: 3 +}; diff --git a/test/comparison-tests/projectReferencesWatch/lib/tsconfig.json b/test/comparison-tests/projectReferencesWatch/lib/tsconfig.json new file mode 100644 index 000000000..506c325eb --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/lib/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "composite": true, + "sourceMap": true + }, + "files": [ + "./index.ts" + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/patch0/lib/index.ts b/test/comparison-tests/projectReferencesWatch/patch0/lib/index.ts new file mode 100644 index 000000000..bcc33a8ba --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/patch0/lib/index.ts @@ -0,0 +1,6 @@ +export const lib = { + one: 1, + two: 2, + three: 3, + four: 4 // Add new number +}; diff --git a/test/comparison-tests/projectReferencesWatch/patch1/app.ts b/test/comparison-tests/projectReferencesWatch/patch1/app.ts new file mode 100644 index 000000000..ef0588c25 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/patch1/app.ts @@ -0,0 +1,3 @@ +import { lib } from './lib'; + +console.log(lib.one, lib.two, lib.three, lib.four); // consume new number diff --git a/test/comparison-tests/projectReferencesWatch/patch2/lib/index.ts b/test/comparison-tests/projectReferencesWatch/patch2/lib/index.ts new file mode 100644 index 000000000..50c5a28cf --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/patch2/lib/index.ts @@ -0,0 +1,7 @@ +export const lib = { + one: 1, + two: 2, + three: 3, + four: 4, // Add new number + , +}; diff --git a/test/comparison-tests/projectReferencesWatch/patch3/lib/index.ts b/test/comparison-tests/projectReferencesWatch/patch3/lib/index.ts new file mode 100644 index 000000000..2f41de9ea --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/patch3/lib/index.ts @@ -0,0 +1,7 @@ +export const lib = { + one: 1, + two: 2, + three: 3, + four: 4, // Add new number + five: 5, +}; diff --git a/test/comparison-tests/projectReferencesWatch/patch4/app.ts b/test/comparison-tests/projectReferencesWatch/patch4/app.ts new file mode 100644 index 000000000..60b81231a --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/patch4/app.ts @@ -0,0 +1,3 @@ +import { lib } from './lib'; + +console.log(lib.one, lib.two, lib.three, lib.four, lib.ffive); // consume new number diff --git a/test/comparison-tests/projectReferencesWatch/patch5/app.ts b/test/comparison-tests/projectReferencesWatch/patch5/app.ts new file mode 100644 index 000000000..57f5f312c --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/patch5/app.ts @@ -0,0 +1,3 @@ +import { lib } from './lib'; + +console.log(lib.one, lib.two, lib.three, lib.four, lib.five); // consume new number diff --git a/test/comparison-tests/projectReferencesWatch/tsconfig.json b/test/comparison-tests/projectReferencesWatch/tsconfig.json new file mode 100644 index 000000000..6d9798ff7 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/tsconfig.json @@ -0,0 +1,8 @@ +{ +"files": [ + "./app.ts" + ], + "references": [ + { "path": "./lib" } + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/webpack.config.js b/test/comparison-tests/projectReferencesWatch/webpack.config.js new file mode 100644 index 000000000..002ea7825 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatch/webpack.config.js @@ -0,0 +1,20 @@ +module.exports = { + mode: 'development', + entry: './app.ts', + output: { + filename: 'bundle.js' + }, + resolve: { + extensions: ['.ts', '.js'] + }, + module: { + rules: [ + { test: /\.ts$/, loader: 'ts-loader', options: { projectReferences: true } } + ] + } +} + +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } + + From 91fe036fcef4eb52293f211730678bd8aea29c8c Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 17 Sep 2019 14:47:40 -0700 Subject: [PATCH 12/19] tsbuildinfo files for referenced projects --- src/after-compile.ts | 40 ++++++++++++- src/instances.ts | 56 +++++++++---------- .../expectedOutput-3.6/output.txt | 7 ++- .../expectedOutput-3.6/output.txt | 7 ++- .../expectedOutput-3.6/output.txt | 7 ++- .../expectedOutput-3.6/output.txt | 7 ++- .../expectedOutput-3.6/output.transpiled.txt | 3 +- .../expectedOutput-3.6/output.txt | 3 +- .../expectedOutput-3.6/output.txt | 7 ++- .../expectedOutput-3.6/output.txt | 7 ++- .../expectedOutput-3.6/patch0/output.txt | 7 ++- .../expectedOutput-3.6/patch1/output.txt | 5 +- .../expectedOutput-3.6/patch2/output.txt | 7 ++- .../expectedOutput-3.6/patch3/output.txt | 7 ++- .../expectedOutput-3.6/patch4/output.txt | 5 +- .../expectedOutput-3.6/patch5/output.txt | 5 +- 16 files changed, 114 insertions(+), 66 deletions(-) diff --git a/src/after-compile.ts b/src/after-compile.ts index 798b8df4a..0e2990f13 100644 --- a/src/after-compile.ts +++ b/src/after-compile.ts @@ -3,7 +3,7 @@ import * as ts from 'typescript'; import * as webpack from 'webpack'; import * as constants from './constants'; -import { getEmitOutput } from './instances'; +import { forEachResolvedProjectReference, getEmitOutput } from './instances'; import { TSFile, TSFiles, @@ -71,6 +71,8 @@ export function makeAfterCompile( loaderContext ); + provideTsBuildInfoFilesToWebpack(instance, compilation); + // append errors compilation.errors.push( ...getSolutionErrors(instance, compilation.compiler.context) @@ -294,6 +296,42 @@ function provideDeclarationFilesToWebpack( } } +/** + * gather all .tsbuildinfo for the project + */ +function provideTsBuildInfoFilesToWebpack( + instance: TSInstance, + compilation: webpack.compilation.Compilation +) { + if (instance.solutionBuilderHost) { + const program = ensureProgram(instance); + if (program) { + forEachResolvedProjectReference( + program.getResolvedProjectReferences(), + resolvedRef => { + // TODO:: update compiler to expose this + const buildInfoPath = (instance.compiler as any).getOutputPathForBuildInfo( + resolvedRef.commandLine.options + ); + if (buildInfoPath) { + const text = instance.compiler.sys.readFile(buildInfoPath); + if (text) { + const assetPath = path.relative( + compilation.compiler.outputPath, + path.resolve(buildInfoPath) + ); + compilation.assets[assetPath] = { + source: () => text, + size: () => text.length + }; + } + } + } + ); + } + } +} + /** * handle all other errors. The basic approach here to get accurate error * reporting is to start with a "blank slate" each compilation and gather diff --git a/src/instances.ts b/src/instances.ts index dd9858e35..14a26d57a 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -375,7 +375,7 @@ function tryAndBuildSolutionReferences( } } -function forEachResolvedProjectReference( +export function forEachResolvedProjectReference( resolvedProjectReferences: | readonly (typescript.ResolvedProjectReference | undefined)[] | undefined, @@ -531,33 +531,33 @@ function getOutputFilesFromReference( filePath: string ): typescript.OutputFile[] | undefined { // May be api to get file - const refs = program.getResolvedProjectReferences(); - return refs - ? forEachResolvedProjectReference(refs, ({ commandLine }) => { - const { options, fileNames } = commandLine; - if ( - !options.outFile && - !options.out && - fileNames.some(file => path.normalize(file) === filePath) - ) { - // TODO api in typescript - // For now copying from typescript - const outputFiles: typescript.OutputFile[] = []; - getOutputFileNames( - instance, - commandLine, - (instance.compiler as any).resolvePath(filePath) - ).forEach(name => { - const text = instance.compiler.sys.readFile(name); - if (text) { - outputFiles.push({ name, text, writeByteOrderMark: false }); - } - }); - return outputFiles; - } - return undefined; - }) - : undefined; + return forEachResolvedProjectReference( + program.getResolvedProjectReferences(), + ({ commandLine }) => { + const { options, fileNames } = commandLine; + if ( + !options.outFile && + !options.out && + fileNames.some(file => path.normalize(file) === filePath) + ) { + // TODO api in typescript + // For now copying from typescript + const outputFiles: typescript.OutputFile[] = []; + getOutputFileNames( + instance, + commandLine, + (instance.compiler as any).resolvePath(filePath) + ).forEach(name => { + const text = instance.compiler.sys.readFile(name); + if (text) { + outputFiles.push({ name, text, writeByteOrderMark: false }); + } + }); + return outputFiles; + } + return undefined; + } + ); } export function isReferencedFile(instance: TSInstance, filePath: string) { diff --git a/test/comparison-tests/projectReferences/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferences/expectedOutput-3.6/output.txt index 2e1ef6d64..0b883ff20 100644 --- a/test/comparison-tests/projectReferences/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferences/expectedOutput-3.6/output.txt @@ -1,6 +1,7 @@ - Asset Size Chunks Chunk Names - bundle.js 4.29 KiB main [emitted] main -../lib/index.d.ts 89 bytes [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.29 KiB main [emitted] main + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] [./lib/index.ts] 104 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt index 07ee1543f..b0f1d6a4f 100644 --- a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt @@ -1,6 +1,7 @@ - Asset Size Chunks Chunk Names - bundle.js 4.69 KiB main [emitted] main -../lib/index.d.ts 107 bytes [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.69 KiB main [emitted] main + ../lib/index.d.ts 107 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.8 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] [./lib/foo.ts] 62 bytes {main} [built] diff --git a/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.txt index 2e1ef6d64..0b883ff20 100644 --- a/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt/expectedOutput-3.6/output.txt @@ -1,6 +1,7 @@ - Asset Size Chunks Chunk Names - bundle.js 4.29 KiB main [emitted] main -../lib/index.d.ts 89 bytes [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.29 KiB main [emitted] main + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] [./lib/index.ts] 104 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.txt index 4e1e2aa4d..c04186771 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/expectedOutput-3.6/output.txt @@ -1,6 +1,7 @@ - Asset Size Chunks Chunk Names - bundle.js 4.31 KiB main [emitted] main -../lib/index.d.ts 89 bytes [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.31 KiB main [emitted] main + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 147 bytes {main} [built] [1 error] [./lib/index.ts] 104 bytes {main} [built] diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt index ede1a31a4..934612f38 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.transpiled.txt @@ -8,6 +8,5 @@ ERROR in tsconfig.json [tsl] ERROR  TS6305: Output file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts'. -ERROR in lib\index.ts -[tsl] ERROR in lib\index.ts(6,7) +ERROR in [tsl] ERROR in lib\index.ts(6,7)  TS2322: Type '10' is not assignable to type 'string'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt index 45cead617..2d1b9e78b 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt @@ -16,6 +16,5 @@ ERROR in tsconfig.json [tsl] ERROR  TS6305: Output file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts'. -ERROR in lib\index.ts -[tsl] ERROR in lib\index.ts(6,7) +ERROR in [tsl] ERROR in lib\index.ts(6,7)  TS2322: Type '10' is not assignable to type 'string'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.txt index ee8c2f922..f225f3d39 100644 --- a/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesRootDir/expectedOutput-3.6/output.txt @@ -1,6 +1,7 @@ - Asset Size Chunks Chunk Names - bundle.js 4.66 KiB main [emitted] main -../lib/out/index.d.ts 89 bytes [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.66 KiB main [emitted] main + ../lib/out/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 71.5 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 81 bytes {main} [built] [./lib/src/index.ts] 66 bytes {main} [built] diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.txt index 2e1ef6d64..0b883ff20 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/output.txt @@ -1,6 +1,7 @@ - Asset Size Chunks Chunk Names - bundle.js 4.29 KiB main [emitted] main -../lib/index.d.ts 89 bytes [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.29 KiB main [emitted] main + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] [./lib/index.ts] 104 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt index 2e1ef6d64..0b883ff20 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt @@ -1,6 +1,7 @@ - Asset Size Chunks Chunk Names - bundle.js 4.29 KiB main [emitted] main -../lib/index.d.ts 89 bytes [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.29 KiB main [emitted] main + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] [./lib/index.ts] 104 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt index 802a2b971..2c1b809e9 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt @@ -1,5 +1,6 @@ - Asset Size Chunks Chunk Names -bundle.js 4.33 KiB main [emitted] main + Asset Size Chunks Chunk Names + bundle.js 4.33 KiB main [emitted] main +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 169 bytes {main} [built] [1 error] [./lib/index.ts] 104 bytes {main} diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt index 09ae91602..65ea40ae2 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt @@ -1,6 +1,7 @@ - Asset Size Chunks Chunk Names - bundle.js 4.33 KiB main [emitted] main -../lib/index.d.ts 89 bytes [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.33 KiB main [emitted] main + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 169 bytes {main} [built] [1 error] [./lib/index.ts] 104 bytes {main} [built] diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt index 09ae91602..65ea40ae2 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt @@ -1,6 +1,7 @@ - Asset Size Chunks Chunk Names - bundle.js 4.33 KiB main [emitted] main -../lib/index.d.ts 89 bytes [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.33 KiB main [emitted] main + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 169 bytes {main} [built] [1 error] [./lib/index.ts] 104 bytes {main} [built] diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt index 3393baeab..cfdaa15ce 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt @@ -1,5 +1,6 @@ - Asset Size Chunks Chunk Names -bundle.js 4.35 KiB main [emitted] main + Asset Size Chunks Chunk Names + bundle.js 4.35 KiB main [emitted] main +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 186 bytes {main} [built] [2 errors] [./lib/index.ts] 104 bytes {main} diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt index 0ff3471ad..983c75a11 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt @@ -1,5 +1,6 @@ - Asset Size Chunks Chunk Names -bundle.js 4.35 KiB main [emitted] main + Asset Size Chunks Chunk Names + bundle.js 4.35 KiB main [emitted] main +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 185 bytes {main} [built] [2 errors] [./lib/index.ts] 104 bytes {main} From 1e5e2315949ad276f5d24f023fa2dde4854806f6 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 18 Sep 2019 09:34:21 -0700 Subject: [PATCH 13/19] Add alias loader so its easy to run from command line --- package.json | 8 ++++---- test/comparison-tests/projectReferences/webpack.config.js | 2 ++ .../projectReferencesNoSourceMap/webpack.config.js | 3 ++- .../projectReferencesNotBuilt/webpack.config.js | 3 ++- .../webpack.config.js | 3 ++- .../webpack.config.js | 3 ++- .../webpack.config.js | 3 ++- .../projectReferencesOutDir/webpack.config.js | 3 ++- .../projectReferencesRootDir/webpack.config.js | 3 ++- .../projectReferencesWatch/webpack.config.js | 4 +--- 10 files changed, 21 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 919f57d21..6b9237ebc 100644 --- a/package.json +++ b/package.json @@ -7,11 +7,11 @@ "scripts": { "build": "tsc --version && tsc --project \"./src\"", "lint": "tslint --project \"./src\"", - "comparison-tests": "tsc --project \"./test/comparison-tests\" && npm link ./test/comparison-tests/testLib && node test/comparison-tests/run-tests.js", - "comparison-tests-generate": "node test/comparison-tests/stub-new-version.js", + "comparison-tests": "git clean -xfd test/comparison-tests && tsc --project \"./test/comparison-tests\" && npm link ./test/comparison-tests/testLib && node test/comparison-tests/run-tests.js", + "comparison-tests-generate": "git clean -xfd test/comparison-tests && node test/comparison-tests/stub-new-version.js", "execution-tests": "git clean -xfd test/execution-tests && node test/execution-tests/run-tests.js", - "test": "git clean -xfd test/execution-tests && node test/run-tests.js", - "clean": "git clean -xfd test/execution-tests", + "test": "git clean -xfd test/comparison-tests && git clean -xfd test/execution-tests && node test/run-tests.js", + "clean": "git clean -xfd test/comparison-tests && git clean -xfd test/execution-tests", "docker:build": "docker build -t ts-loader .", "postdocker:build": "docker run -it ts-loader yarn test" }, diff --git a/test/comparison-tests/projectReferences/webpack.config.js b/test/comparison-tests/projectReferences/webpack.config.js index 0dca2dae2..a8a142774 100644 --- a/test/comparison-tests/projectReferences/webpack.config.js +++ b/test/comparison-tests/projectReferences/webpack.config.js @@ -16,4 +16,6 @@ module.exports = { } } +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } diff --git a/test/comparison-tests/projectReferencesNoSourceMap/webpack.config.js b/test/comparison-tests/projectReferencesNoSourceMap/webpack.config.js index 0dca2dae2..1d80e4c54 100644 --- a/test/comparison-tests/projectReferencesNoSourceMap/webpack.config.js +++ b/test/comparison-tests/projectReferencesNoSourceMap/webpack.config.js @@ -16,4 +16,5 @@ module.exports = { } } - +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } diff --git a/test/comparison-tests/projectReferencesNotBuilt/webpack.config.js b/test/comparison-tests/projectReferencesNotBuilt/webpack.config.js index 0dca2dae2..81cd477e4 100644 --- a/test/comparison-tests/projectReferencesNotBuilt/webpack.config.js +++ b/test/comparison-tests/projectReferencesNotBuilt/webpack.config.js @@ -16,4 +16,5 @@ module.exports = { } } - +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/webpack.config.js b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/webpack.config.js index 0dca2dae2..81cd477e4 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/webpack.config.js +++ b/test/comparison-tests/projectReferencesNotBuilt_ErrorInProject/webpack.config.js @@ -16,4 +16,5 @@ module.exports = { } } - +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/webpack.config.js b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/webpack.config.js index 0dca2dae2..81cd477e4 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/webpack.config.js +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/webpack.config.js @@ -16,4 +16,5 @@ module.exports = { } } - +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/webpack.config.js b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/webpack.config.js index 0dca2dae2..81cd477e4 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/webpack.config.js +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/webpack.config.js @@ -16,4 +16,5 @@ module.exports = { } } - +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesOutDir/webpack.config.js b/test/comparison-tests/projectReferencesOutDir/webpack.config.js index 0dca2dae2..81cd477e4 100644 --- a/test/comparison-tests/projectReferencesOutDir/webpack.config.js +++ b/test/comparison-tests/projectReferencesOutDir/webpack.config.js @@ -16,4 +16,5 @@ module.exports = { } } - +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesRootDir/webpack.config.js b/test/comparison-tests/projectReferencesRootDir/webpack.config.js index 0dca2dae2..1d80e4c54 100644 --- a/test/comparison-tests/projectReferencesRootDir/webpack.config.js +++ b/test/comparison-tests/projectReferencesRootDir/webpack.config.js @@ -16,4 +16,5 @@ module.exports = { } } - +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } diff --git a/test/comparison-tests/projectReferencesWatch/webpack.config.js b/test/comparison-tests/projectReferencesWatch/webpack.config.js index 002ea7825..7c1c875fe 100644 --- a/test/comparison-tests/projectReferencesWatch/webpack.config.js +++ b/test/comparison-tests/projectReferencesWatch/webpack.config.js @@ -15,6 +15,4 @@ module.exports = { } // for test harness purposes only, you would not need this in a normal project -module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } - - +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } \ No newline at end of file From d3c82fb2cf85b98054c7bd936fb70a0ed8761acc Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 18 Sep 2019 12:34:28 -0700 Subject: [PATCH 14/19] Fix incorrect scheduling of the next build and fix copy for tests to write new files --- src/servicesHost.ts | 46 ++++++++----------- test/comparison-tests/copySync.js | 43 +++++++++++++++++ .../create-and-execute-test.js | 9 ++-- .../expectedOutput-3.6/patch0/bundle.js | 2 +- .../expectedOutput-3.6/patch0/output.txt | 10 ++-- .../expectedOutput-3.6/patch1/bundle.js | 2 +- .../expectedOutput-3.6/patch1/output.txt | 11 ++--- .../expectedOutput-3.6/patch2/bundle.js | 2 +- .../expectedOutput-3.6/patch2/output.txt | 21 +++++---- .../expectedOutput-3.6/patch3/bundle.js | 2 +- .../expectedOutput-3.6/patch3/output.txt | 17 +++---- .../expectedOutput-3.6/patch4/bundle.js | 2 +- .../expectedOutput-3.6/patch4/output.txt | 13 ++---- .../expectedOutput-3.6/patch5/bundle.js | 2 +- .../expectedOutput-3.6/patch5/output.txt | 16 ++----- test/comparison-tests/stub-new-version.js | 9 ++-- test/comparison-tests/tsconfig.json | 3 +- 17 files changed, 113 insertions(+), 97 deletions(-) create mode 100644 test/comparison-tests/copySync.js diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 60cab271e..36f6122a4 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -244,6 +244,7 @@ function makeResolvers( function createWatchFactory( beforeCallbacks?: ( + key: string, cb: typescript.FileWatcherCallback[] | typescript.DirectoryWatcherCallback[] ) => void ): WatchFactory { @@ -268,28 +269,20 @@ function createWatchFactory( }; function invokeWatcherCallbacks( - callbacks: typescript.FileWatcherCallback[] | undefined, - fileName: string, - eventKind: typescript.FileWatcherEventKind - ): void; - function invokeWatcherCallbacks( - callbacks: typescript.DirectoryWatcherCallback[] | undefined, - fileName: string - ): void; - function invokeWatcherCallbacks( - callbacks: - | typescript.FileWatcherCallback[] - | typescript.DirectoryWatcherCallback[] - | undefined, + map: + | Map + | Map, + key: string, fileName: string, eventKind?: typescript.FileWatcherEventKind ) { + const callbacks = map.get(key); if (callbacks !== undefined && callbacks.length) { // The array copy is made to ensure that even if one of the callback removes the callbacks, // we dont miss any callbacks following it const cbs = callbacks.slice(); if (beforeCallbacks) { - beforeCallbacks(cbs); + beforeCallbacks(key, cbs); } for (const cb of cbs) { cb(fileName, eventKind as typescript.FileWatcherEventKind); @@ -302,7 +295,7 @@ function createWatchFactory( eventKind: typescript.FileWatcherEventKind ) { fileName = path.normalize(fileName); - invokeWatcherCallbacks(watchedFiles.get(fileName), fileName, eventKind); + invokeWatcherCallbacks(watchedFiles, fileName, fileName, eventKind); } function invokeDirectoryWatcher( @@ -310,10 +303,7 @@ function createWatchFactory( fileAddedOrRemoved: string ) { directory = path.normalize(directory); - invokeWatcherCallbacks( - watchedDirectories.get(directory), - fileAddedOrRemoved - ); + invokeWatcherCallbacks(watchedDirectories, directory, fileAddedOrRemoved); invokeRecursiveDirectoryWatcher(directory, fileAddedOrRemoved); } @@ -323,7 +313,8 @@ function createWatchFactory( ) { directory = path.normalize(directory); invokeWatcherCallbacks( - watchedDirectoriesRecursive.get(directory), + watchedDirectoriesRecursive, + directory, fileAddedOrRemoved ); const basePath = path.dirname(directory); @@ -633,16 +624,19 @@ export function makeSolutionBuilderHost( reportWatchStatus ), diagnostics: [], - ...createWatchFactory(beforeWatchCallbacks) + ...createWatchFactory(beforeWatchCallbacks), + // Overrides + getCurrentDirectory, + writeFile: (name, text, writeByteOrderMark) => { + compiler.sys.writeFile(name, text, writeByteOrderMark); + updateFileWithText(instance, name, () => text); + }, + setTimeout: undefined, + clearTimeout: undefined }; - solutionBuilderHost.getCurrentDirectory = getCurrentDirectory; solutionBuilderHost.trace = logData => log.logInfo(logData); solutionBuilderHost.getParsedCommandLine = file => getParsedCommandLine(compiler, instance.loaderOptions, file); - solutionBuilderHost.writeFile = (name, text, writeByteOrderMark) => { - compiler.sys.writeFile(name, text, writeByteOrderMark); - updateFileWithText(instance, name, () => text); - }; // make a (sync) resolver that follows webpack's rules const resolveSync = makeResolver(loader._compiler.options); diff --git a/test/comparison-tests/copySync.js b/test/comparison-tests/copySync.js new file mode 100644 index 000000000..5f0e42a09 --- /dev/null +++ b/test/comparison-tests/copySync.js @@ -0,0 +1,43 @@ +const fs = require('fs'); +const path = require('path'); + +module.exports = function copySync(src, dest) { + try { + fs.mkdirSync(dest); + } + catch (e) { + if (e.code !== "EEXIST") { + // Failed for some other reason (access denied?); still throw + throw e; + } + } + + for (const entry of fs.readdirSync(src)) { + // This is necessary because on some file system node fails to exclude + // "." and "..". See https://github.com/nodejs/node/issues/4002 + if (entry === "." || entry === "..") { + continue; + } + const srcName = path.resolve(src, entry); + const destName = path.resolve(dest, entry); + + let stat; + try { + stat = fs.lstatSync(srcName); + } + catch (e) { + continue; + } + + if (stat.isSymbolicLink()) { + fs.symlinkSync(fs.readlinkSync(srcName), destName); + } + else if (stat.isFile()) { + // Write the file + fs.writeFileSync(destName, fs.readFileSync(srcName)); + } + else if (stat.isDirectory()) { + copySync(srcName, destName); + } + } +} \ No newline at end of file diff --git a/test/comparison-tests/create-and-execute-test.js b/test/comparison-tests/create-and-execute-test.js index 03b4f3f78..1577491a1 100644 --- a/test/comparison-tests/create-and-execute-test.js +++ b/test/comparison-tests/create-and-execute-test.js @@ -12,6 +12,7 @@ const semver = require('semver'); const glob = require('glob'); const pathExists = require('../pathExists'); const aliasLoader = require('../aliasLoader'); +const copySync = require('./copySync'); const saveOutputMode = process.argv.indexOf('--save-output') !== -1; @@ -91,7 +92,7 @@ function createTest(test, testPath, options) { // copy all input to a staging area mkdirp.sync(paths.testStagingPath); - fs.copySync(testPath, paths.testStagingPath); + copySync(testPath, paths.testStagingPath); // ensure output directories mkdirp.sync(paths.actualOutput); @@ -184,7 +185,7 @@ function createWebpackWatchHandler(done, paths, testState, outputs, options, tes saveOutputIfRequired(saveOutputMode, paths, outputs, options, patch); - fs.copySync(paths.webpackOutput, paths.actualOutput); + copySync(paths.webpackOutput, paths.actualOutput); rimraf.sync(paths.webpackOutput); handleErrors(err, paths, outputs, patch, options); @@ -230,7 +231,7 @@ function saveOutputIfRequired(saveOutputMode, paths, outputs, options, patch) { } }); - fs.copySync(paths.webpackOutput, paths.originalExpectedOutput, { overwrite: true }); + copySync(paths.webpackOutput, paths.originalExpectedOutput); } } @@ -343,7 +344,7 @@ function copyPatchOrEndTest(testStagingPath, watcher, testState, done) { // can get inconsistent results if copying right away setTimeout(function () { - fs.copySync(patchPath, testStagingPath, { overwrite: true }); + copySync(patchPath, testStagingPath); }, 1000); } else { diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.js index 7b491a754..e41275feb 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.js +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/bundle.js @@ -106,7 +106,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3,\r\n four: 4 // Add new number\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt index 0b883ff20..45d8f7737 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch0/output.txt @@ -1,7 +1,7 @@ - Asset Size Chunks Chunk Names - bundle.js 4.29 KiB main [emitted] main - ../lib/index.d.ts 89 bytes [emitted] -../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.33 KiB main [emitted] main + ../lib/index.d.ts 108 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/index.ts] 104 bytes {main} [built] \ No newline at end of file +[./lib/index.ts] 136 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.js index 303a19052..d7d6292ed 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.js +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/bundle.js @@ -106,7 +106,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3,\r\n four: 4 // Add new number\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt index 2c1b809e9..ba9e0393c 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt @@ -1,11 +1,6 @@ Asset Size Chunks Chunk Names - bundle.js 4.33 KiB main [emitted] main + bundle.js 4.36 KiB main [emitted] main ../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 169 bytes {main} [built] [1 error] -[./lib/index.ts] 104 bytes {main} - -ERROR in app.ts -./app.ts -[tsl] ERROR in app.ts(3,46) - TS2339: Property 'four' does not exist on type '{ one: number; two: number; three: number; }'. \ No newline at end of file +[./app.ts] 169 bytes {main} [built] +[./lib/index.ts] 136 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.js index 303a19052..d7d6292ed 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.js +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/bundle.js @@ -106,7 +106,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3,\r\n four: 4 // Add new number\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt index 65ea40ae2..47604851e 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt @@ -1,12 +1,13 @@ - Asset Size Chunks Chunk Names - bundle.js 4.33 KiB main [emitted] main - ../lib/index.d.ts 89 bytes [emitted] -../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.36 KiB main [emitted] main + ../lib/index.d.ts 108 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 169 bytes {main} [built] [1 error] -[./lib/index.ts] 104 bytes {main} [built] +[./app.ts] 169 bytes {main} [built] +[./lib/index.ts] 136 bytes {main} [built] -ERROR in app.ts -./app.ts -[tsl] ERROR in app.ts(3,46) - TS2339: Property 'four' does not exist on type '{ one: number; two: number; three: number; }'. \ No newline at end of file +ERROR in [tsl] ERROR in lib\index.ts(6,3) + TS1136: Property assignment expected. + +ERROR in [tsl] ERROR in lib\index.ts(7,1) + TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.js index 303a19052..4baf2067a 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.js +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/bundle.js @@ -106,7 +106,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3,\r\n four: 4,\r\n five: 5\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt index 65ea40ae2..c4dd65cf6 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch3/output.txt @@ -1,12 +1,7 @@ - Asset Size Chunks Chunk Names - bundle.js 4.33 KiB main [emitted] main - ../lib/index.d.ts 89 bytes [emitted] -../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.36 KiB main [emitted] main + ../lib/index.d.ts 127 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 169 bytes {main} [built] [1 error] -[./lib/index.ts] 104 bytes {main} [built] - -ERROR in app.ts -./app.ts -[tsl] ERROR in app.ts(3,46) - TS2339: Property 'four' does not exist on type '{ one: number; two: number; three: number; }'. \ No newline at end of file +[./app.ts] 169 bytes {main} [built] +[./lib/index.ts] 132 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.js index 6bb011ea7..5399bc407 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.js +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/bundle.js @@ -106,7 +106,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3,\r\n four: 4,\r\n five: 5\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt index cfdaa15ce..831e451c7 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt @@ -1,16 +1,11 @@ Asset Size Chunks Chunk Names - bundle.js 4.35 KiB main [emitted] main + bundle.js 4.38 KiB main [emitted] main ../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 186 bytes {main} [built] [2 errors] -[./lib/index.ts] 104 bytes {main} - -ERROR in app.ts -./app.ts -[tsl] ERROR in app.ts(3,46) - TS2339: Property 'four' does not exist on type '{ one: number; two: number; three: number; }'. +[./app.ts] 186 bytes {main} [built] [1 error] +[./lib/index.ts] 132 bytes {main} ERROR in app.ts ./app.ts [tsl] ERROR in app.ts(3,56) - TS2339: Property 'ffive' does not exist on type '{ one: number; two: number; three: number; }'. \ No newline at end of file + TS2551: Property 'ffive' does not exist on type '{ one: number; two: number; three: number; four: number; five: number; }'. Did you mean 'five'? \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.js b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.js index 6b0cde9cc..4d4687802 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.js +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/bundle.js @@ -106,7 +106,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3,\r\n four: 4,\r\n five: 5\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt index 983c75a11..092165757 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt @@ -1,16 +1,6 @@ Asset Size Chunks Chunk Names - bundle.js 4.35 KiB main [emitted] main + bundle.js 4.38 KiB main [emitted] main ../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 185 bytes {main} [built] [2 errors] -[./lib/index.ts] 104 bytes {main} - -ERROR in app.ts -./app.ts -[tsl] ERROR in app.ts(3,46) - TS2339: Property 'four' does not exist on type '{ one: number; two: number; three: number; }'. - -ERROR in app.ts -./app.ts -[tsl] ERROR in app.ts(3,56) - TS2339: Property 'five' does not exist on type '{ one: number; two: number; three: number; }'. \ No newline at end of file +[./app.ts] 185 bytes {main} [built] +[./lib/index.ts] 132 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/stub-new-version.js b/test/comparison-tests/stub-new-version.js index 71d6ef2d9..af5229382 100644 --- a/test/comparison-tests/stub-new-version.js +++ b/test/comparison-tests/stub-new-version.js @@ -1,6 +1,7 @@ -var fs = require('fs-extra'); -var path = require('path'); -var mkdirp = require('mkdirp'); +const fs = require('fs-extra'); +const path = require('path'); +const mkdirp = require('mkdirp'); +const copySync = require('./copySync'); fs.readdirSync(__dirname).forEach(function(test) { var testPath = path.join(__dirname, test); @@ -13,6 +14,6 @@ fs.readdirSync(__dirname).forEach(function(test) { newExpectedOutput = path.join(testPath, 'expectedOutput-3.6'); mkdirp.sync(newExpectedOutput); - fs.copySync(expectedOutput, newExpectedOutput); + copySync(expectedOutput, newExpectedOutput); } }); diff --git a/test/comparison-tests/tsconfig.json b/test/comparison-tests/tsconfig.json index 5b7770a34..b3ac4b3a5 100644 --- a/test/comparison-tests/tsconfig.json +++ b/test/comparison-tests/tsconfig.json @@ -9,6 +9,7 @@ "files": [ "create-and-execute-test.js", "run-tests.js", - "newline.loader.js" + "newline.loader.js", + "copySync.js" ] } \ No newline at end of file From 0cadb2c5e6a0384e31128cca1a72e413a0e4efc2 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 18 Sep 2019 13:35:33 -0700 Subject: [PATCH 15/19] Set tsbuildinfo as asset only if emitting the file from referenced project --- src/after-compile.ts | 38 +++++++++++-------- .../expectedOutput-3.6/patch1/output.txt | 5 +-- .../expectedOutput-3.6/patch4/output.txt | 5 +-- .../expectedOutput-3.6/patch5/output.txt | 5 +-- 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/after-compile.ts b/src/after-compile.ts index 0e2990f13..3eec6269e 100644 --- a/src/after-compile.ts +++ b/src/after-compile.ts @@ -303,27 +303,33 @@ function provideTsBuildInfoFilesToWebpack( instance: TSInstance, compilation: webpack.compilation.Compilation ) { - if (instance.solutionBuilderHost) { + if (instance.solutionBuilderHost && instance.modifiedFiles) { const program = ensureProgram(instance); if (program) { forEachResolvedProjectReference( program.getResolvedProjectReferences(), resolvedRef => { - // TODO:: update compiler to expose this - const buildInfoPath = (instance.compiler as any).getOutputPathForBuildInfo( - resolvedRef.commandLine.options - ); - if (buildInfoPath) { - const text = instance.compiler.sys.readFile(buildInfoPath); - if (text) { - const assetPath = path.relative( - compilation.compiler.outputPath, - path.resolve(buildInfoPath) - ); - compilation.assets[assetPath] = { - source: () => text, - size: () => text.length - }; + if ( + resolvedRef.commandLine.fileNames.some(f => + instance.modifiedFiles!.has(path.resolve(f)) + ) + ) { + // TODO:: update compiler to expose this + const buildInfoPath = (instance.compiler as any).getOutputPathForBuildInfo( + resolvedRef.commandLine.options + ); + if (buildInfoPath) { + const text = instance.compiler.sys.readFile(buildInfoPath); + if (text) { + const assetPath = path.relative( + compilation.compiler.outputPath, + path.resolve(buildInfoPath) + ); + compilation.assets[assetPath] = { + source: () => text, + size: () => text.length + }; + } } } } diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt index ba9e0393c..863917568 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch1/output.txt @@ -1,6 +1,5 @@ - Asset Size Chunks Chunk Names - bundle.js 4.36 KiB main [emitted] main -../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] + Asset Size Chunks Chunk Names +bundle.js 4.36 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 169 bytes {main} [built] [./lib/index.ts] 136 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt index 831e451c7..f0e824b1a 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch4/output.txt @@ -1,6 +1,5 @@ - Asset Size Chunks Chunk Names - bundle.js 4.38 KiB main [emitted] main -../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] + Asset Size Chunks Chunk Names +bundle.js 4.38 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 186 bytes {main} [built] [1 error] [./lib/index.ts] 132 bytes {main} diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt index 092165757..bd093b647 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch5/output.txt @@ -1,6 +1,5 @@ - Asset Size Chunks Chunk Names - bundle.js 4.38 KiB main [emitted] main -../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] + Asset Size Chunks Chunk Names +bundle.js 4.38 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 185 bytes {main} [built] [./lib/index.ts] 132 bytes {main} \ No newline at end of file From 8b5578f3f8824c990db3cd5e62e8f7ee16426f66 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 18 Sep 2019 14:31:28 -0700 Subject: [PATCH 16/19] Add support when the file is referenced indirectly from project --- src/after-compile.ts | 11 +- src/index.ts | 2 +- src/instances.ts | 16 +-- .../app.ts | 3 + .../expectedOutput-3.6/bundle.js | 125 ++++++++++++++++++ .../expectedOutput-3.6/bundle.transpiled.js | 125 ++++++++++++++++++ .../expectedOutput-3.6/output.transpiled.txt | 6 + .../expectedOutput-3.6/output.txt | 9 ++ .../expectedOutput-3.6/patch0/bundle.js | 125 ++++++++++++++++++ .../patch0/bundle.transpiled.js | 125 ++++++++++++++++++ .../patch0/output.transpiled.txt | 6 + .../expectedOutput-3.6/patch0/output.txt | 9 ++ .../expectedOutput-3.6/patch1/bundle.js | 125 ++++++++++++++++++ .../patch1/bundle.transpiled.js | 125 ++++++++++++++++++ .../patch1/output.transpiled.txt | 6 + .../expectedOutput-3.6/patch1/output.txt | 6 + .../lib/.gitignore | 1 + .../lib/helper.ts | 5 + .../lib/index.ts | 6 + .../lib/tsconfig.json | 10 ++ .../patch0/lib/helper.ts | 6 + .../patch1/app.ts | 4 + .../tsconfig.json | 8 ++ .../webpack.config.js | 18 +++ 24 files changed, 861 insertions(+), 21 deletions(-) create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/app.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/output.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/output.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/output.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/.gitignore create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/helper.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/index.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/patch0/lib/helper.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/patch1/app.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFiles/webpack.config.js diff --git a/src/after-compile.ts b/src/after-compile.ts index 3eec6269e..10ab77852 100644 --- a/src/after-compile.ts +++ b/src/after-compile.ts @@ -21,8 +21,7 @@ import { export function makeAfterCompile( instance: TSInstance, - configFilePath: string | undefined, - loaderContext: webpack.loader.LoaderContext + configFilePath: string | undefined ) { let getCompilerOptionDiagnostics = true; let checkAllFilesForErrors = true; @@ -67,8 +66,7 @@ export function makeAfterCompile( provideDeclarationFilesToWebpack( filesToCheckForErrors, instance, - compilation, - loaderContext + compilation ); provideTsBuildInfoFilesToWebpack(instance, compilation); @@ -270,15 +268,14 @@ function provideErrorsToWebpack( function provideDeclarationFilesToWebpack( filesToCheckForErrors: TSFiles, instance: TSInstance, - compilation: webpack.compilation.Compilation, - loaderContext: webpack.loader.LoaderContext + compilation: webpack.compilation.Compilation ) { for (const filePath of filesToCheckForErrors.keys()) { if (filePath.match(constants.tsTsxRegex) === null) { continue; } - const outputFiles = getEmitOutput(instance, filePath, loaderContext); + const outputFiles = getEmitOutput(instance, filePath); const declarationFiles = outputFiles.filter(outputFile => outputFile.name.match(constants.dtsDtsxOrDtsDtsxMapRegex) ); diff --git a/src/index.ts b/src/index.ts index d0a6a723a..7e8125905 100644 --- a/src/index.ts +++ b/src/index.ts @@ -442,7 +442,7 @@ function getEmit( instance: TSInstance, loaderContext: webpack.loader.LoaderContext ) { - const outputFiles = getEmitOutput(instance, filePath, loaderContext); + const outputFiles = getEmitOutput(instance, filePath); if (!isReferencedFile(instance, filePath)) { loaderContext.clearDependencies(); diff --git a/src/instances.ts b/src/instances.ts index 14a26d57a..4474c3be2 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -339,7 +339,7 @@ function successfulTypeScriptInstance( loader._compiler.hooks.afterCompile.tapAsync( 'ts-loader', - makeAfterCompile(instance, configFilePath, loader) + makeAfterCompile(instance, configFilePath) ); loader._compiler.hooks.watchRun.tapAsync('ts-loader', makeWatchRun(instance)); @@ -567,19 +567,11 @@ export function isReferencedFile(instance: TSInstance, filePath: string) { ); } -export function getEmitOutput( - instance: TSInstance, - filePath: string, - loaderContext: webpack.loader.LoaderContext -) { +export function getEmitOutput(instance: TSInstance, filePath: string) { const program = ensureProgram(instance); if (program !== undefined) { const sourceFile = program.getSourceFile(filePath); - if ( - sourceFile && - instance.solutionBuilderHost && - path.resolve(sourceFile.fileName) !== path.resolve(filePath) - ) { + if (instance.solutionBuilderHost) { const builtReferences = getOutputFilesFromReference( program, instance, @@ -588,8 +580,6 @@ export function getEmitOutput( if (builtReferences) { return builtReferences; } - loaderContext.emitWarning(`No output found for ${filePath}`); - return []; } const outputFiles: typescript.OutputFile[] = []; const writeFile = ( diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/app.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/app.ts new file mode 100644 index 000000000..a83f2065b --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/app.ts @@ -0,0 +1,3 @@ +import { lib } from './lib'; + +console.log(lib.one, lib.two, lib.three); diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/bundle.js new file mode 100644 index 000000000..d01765a8e --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/bundle.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.helper = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\r\nexports.lib = {\r\n one: helper_1.helper.one,\r\n two: helper_1.helper.two,\r\n three: helper_1.helper.three\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/bundle.transpiled.js new file mode 100644 index 000000000..958994b3b --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/bundle.transpiled.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.helper = {\n one: 1,\n two: 2,\n three: 3\n};\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\nexports.lib = {\n one: helper_1.helper.one,\n two: helper_1.helper.two,\n three: helper_1.helper.three\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/output.transpiled.txt new file mode 100644 index 000000000..af28e43ce --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/output.transpiled.txt @@ -0,0 +1,6 @@ + Asset Size Chunks Chunk Names +bundle.js 4.88 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 167 bytes {main} [built] +[./lib/helper.ts] 136 bytes {main} [built] +[./lib/index.ts] 225 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/output.txt new file mode 100644 index 000000000..0f3ab59b1 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/output.txt @@ -0,0 +1,9 @@ + Asset Size Chunks Chunk Names + bundle.js 4.8 KiB main [emitted] main + ../lib/index.d.ts 89 bytes [emitted] + ../lib/helper.d.ts 92 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.8 KiB [emitted] +Entrypoint main = bundle.js +[./app.ts] 131 bytes {main} [built] +[./lib/helper.ts] 107 bytes {main} [built] +[./lib/index.ts] 197 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/bundle.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/bundle.js new file mode 100644 index 000000000..d62de8dc5 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/bundle.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.helper = {\r\n one: 1,\r\n two: 2,\r\n three: 3,\r\n four: 4\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\r\nexports.lib = {\r\n one: helper_1.helper.one,\r\n two: helper_1.helper.two,\r\n three: helper_1.helper.three\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/bundle.transpiled.js new file mode 100644 index 000000000..9b67527c2 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/bundle.transpiled.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.helper = {\n one: 1,\n two: 2,\n three: 3,\n four: 4\n};\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\nexports.lib = {\n one: helper_1.helper.one,\n two: helper_1.helper.two,\n three: helper_1.helper.three\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/output.transpiled.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/output.transpiled.txt new file mode 100644 index 000000000..89950814d --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/output.transpiled.txt @@ -0,0 +1,6 @@ + Asset Size Chunks Chunk Names +bundle.js 4.9 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 167 bytes {main} +[./lib/helper.ts] 149 bytes {main} [built] +[./lib/index.ts] 225 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/output.txt new file mode 100644 index 000000000..3b632b27c --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch0/output.txt @@ -0,0 +1,9 @@ + Asset Size Chunks Chunk Names + bundle.js 4.82 KiB main [emitted] main + ../lib/helper.d.ts 111 bytes [emitted] + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.8 KiB [emitted] +Entrypoint main = bundle.js +[./app.ts] 131 bytes {main} [built] +[./lib/helper.ts] 121 bytes {main} [built] +[./lib/index.ts] 197 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/bundle.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/bundle.js new file mode 100644 index 000000000..026970b86 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/bundle.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar helper_1 = __webpack_require__(/*! ./lib/helper */ \"./lib/helper.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, helper_1.helper.four); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.helper = {\r\n one: 1,\r\n two: 2,\r\n three: 3,\r\n four: 4\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\r\nexports.lib = {\r\n one: helper_1.helper.one,\r\n two: helper_1.helper.two,\r\n three: helper_1.helper.three\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/bundle.transpiled.js new file mode 100644 index 000000000..f4b1a4280 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/bundle.transpiled.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar helper_1 = __webpack_require__(/*! ./lib/helper */ \"./lib/helper.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, helper_1.helper.four); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.helper = {\n one: 1,\n two: 2,\n three: 3,\n four: 4\n};\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\nexports.lib = {\n one: helper_1.helper.one,\n two: helper_1.helper.two,\n three: helper_1.helper.three\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/output.transpiled.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/output.transpiled.txt new file mode 100644 index 000000000..6b6f0294e --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/output.transpiled.txt @@ -0,0 +1,6 @@ + Asset Size Chunks Chunk Names +bundle.js 5.02 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 251 bytes {main} [built] +[./lib/helper.ts] 149 bytes {main} +[./lib/index.ts] 225 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/output.txt new file mode 100644 index 000000000..1bd1d4dfc --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.6/patch1/output.txt @@ -0,0 +1,6 @@ + Asset Size Chunks Chunk Names +bundle.js 4.94 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 215 bytes {main} [built] +[./lib/helper.ts] 121 bytes {main} +[./lib/index.ts] 197 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/.gitignore b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/.gitignore new file mode 100644 index 000000000..7b7f62099 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/.gitignore @@ -0,0 +1 @@ +!*.js.map \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/helper.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/helper.ts new file mode 100644 index 000000000..4d0db74d4 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/helper.ts @@ -0,0 +1,5 @@ +export const helper = { + one: 1, + two: 2, + three: 3 +}; diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/index.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/index.ts new file mode 100644 index 000000000..0543e95fb --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/index.ts @@ -0,0 +1,6 @@ +import { helper } from './helper'; +export const lib = { + one: helper.one, + two: helper.two, + three: helper.three +}; diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/tsconfig.json b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/tsconfig.json new file mode 100644 index 000000000..97686f819 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/lib/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "composite": true, + "sourceMap": true + }, + "files": [ + "./index.ts", + "./helper.ts" + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/patch0/lib/helper.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/patch0/lib/helper.ts new file mode 100644 index 000000000..7538d158b --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/patch0/lib/helper.ts @@ -0,0 +1,6 @@ +export const helper = { + one: 1, + two: 2, + three: 3, + four: 4 +}; diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/patch1/app.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/patch1/app.ts new file mode 100644 index 000000000..991614300 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/patch1/app.ts @@ -0,0 +1,4 @@ +import { lib } from './lib'; +import { helper } from './lib/helper'; + +console.log(lib.one, lib.two, lib.three, helper.four); // consume new number diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/tsconfig.json b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/tsconfig.json new file mode 100644 index 000000000..6d9798ff7 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/tsconfig.json @@ -0,0 +1,8 @@ +{ +"files": [ + "./app.ts" + ], + "references": [ + { "path": "./lib" } + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/webpack.config.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/webpack.config.js new file mode 100644 index 000000000..7c1c875fe --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/webpack.config.js @@ -0,0 +1,18 @@ +module.exports = { + mode: 'development', + entry: './app.ts', + output: { + filename: 'bundle.js' + }, + resolve: { + extensions: ['.ts', '.js'] + }, + module: { + rules: [ + { test: /\.ts$/, loader: 'ts-loader', options: { projectReferences: true } } + ] + } +} + +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } \ No newline at end of file From 645831168433a44eaf4509213d6463a8c1bf8542 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 18 Sep 2019 15:09:08 -0700 Subject: [PATCH 17/19] Support when referenced project is already built --- src/instances.ts | 2 +- .../create-and-execute-test.js | 9 +- .../app.ts | 3 + .../expectedOutput-3.6/bundle.js | 125 ++ .../expectedOutput-3.6/bundle.transpiled.js | 125 ++ .../expectedOutput-3.6/output.transpiled.txt | 6 + .../expectedOutput-3.6/output.txt | 9 + .../expectedOutput-3.6/patch0/bundle.js | 125 ++ .../patch0/bundle.transpiled.js | 125 ++ .../patch0/output.transpiled.txt | 6 + .../expectedOutput-3.6/patch0/output.txt | 8 + .../expectedOutput-3.6/patch1/bundle.js | 125 ++ .../patch1/bundle.transpiled.js | 125 ++ .../patch1/output.transpiled.txt | 6 + .../expectedOutput-3.6/patch1/output.txt | 9 + .../expectedOutput-3.6/patch2/bundle.js | 125 ++ .../patch2/bundle.transpiled.js | 125 ++ .../patch2/output.transpiled.txt | 6 + .../expectedOutput-3.6/patch2/output.txt | 6 + .../lib/.gitignore | 1 + .../lib/helper.ts | 5 + .../lib/index.ts | 6 + .../lib/tsconfig.json | 10 + .../libOutput/.gitignore | 1 + .../libOutput/helper.d.ts | 5 + .../libOutput/helper.js | 8 + .../libOutput/helper.js.map | 1 + .../libOutput/index.d.ts | 5 + .../libOutput/index.js | 9 + .../libOutput/index.js.map | 1 + .../libOutput/tsconfig.tsbuildinfo | 1336 +++++++++++++++++ .../patch0/lib/index.ts | 7 + .../patch1/lib/helper.ts | 6 + .../patch2/app.ts | 4 + .../tsconfig.json | 8 + .../webpack.config.js | 18 + 36 files changed, 2498 insertions(+), 3 deletions(-) create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/app.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/output.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/output.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/output.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/bundle.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/bundle.transpiled.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/output.transpiled.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/output.txt create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/.gitignore create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/helper.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/index.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/.gitignore create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.d.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.js.map create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.d.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.js create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.js.map create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/tsconfig.tsbuildinfo create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch0/lib/index.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch1/lib/helper.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch2/app.ts create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/webpack.config.js diff --git a/src/instances.ts b/src/instances.ts index 4474c3be2..94bc8f8a1 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -571,7 +571,7 @@ export function getEmitOutput(instance: TSInstance, filePath: string) { const program = ensureProgram(instance); if (program !== undefined) { const sourceFile = program.getSourceFile(filePath); - if (instance.solutionBuilderHost) { + if (isReferencedFile(instance, filePath)) { const builtReferences = getOutputFilesFromReference( program, instance, diff --git a/test/comparison-tests/create-and-execute-test.js b/test/comparison-tests/create-and-execute-test.js index 1577491a1..90eddf813 100644 --- a/test/comparison-tests/create-and-execute-test.js +++ b/test/comparison-tests/create-and-execute-test.js @@ -79,7 +79,6 @@ if (fs.statSync(testPath).isDirectory() && function createTest(test, testPath, options) { return function (done) { this.timeout(60000); // sometimes it just takes awhile - const testState = createTestState(); const paths = createPaths(stagingPath, test, options); const outputs = { @@ -93,6 +92,13 @@ function createTest(test, testPath, options) { // copy all input to a staging area mkdirp.sync(paths.testStagingPath); copySync(testPath, paths.testStagingPath); + if (test === "projectReferencesWatchRefWithTwoFilesAlreadyBuilt") { + // Copy output + copySync(path.resolve(testPath, "libOutput"), path.resolve(paths.testStagingPath, "lib")); + // Change the buildinfo to use typescript version we have + const buildInfoPath = path.resolve(paths.testStagingPath, "lib/tsconfig.tsbuildinfo"); + fs.writeFileSync(buildInfoPath, fs.readFileSync(buildInfoPath, "utf8").replace("FakeTSVersion", typescript.version)); + } // ensure output directories mkdirp.sync(paths.actualOutput); @@ -341,7 +347,6 @@ function copyPatchOrEndTest(testStagingPath, watcher, testState, done) { const patchPath = path.join(testStagingPath, 'patch' + testState.iteration); if (fs.existsSync(patchPath)) { testState.iteration++; - // can get inconsistent results if copying right away setTimeout(function () { copySync(patchPath, testStagingPath); diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/app.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/app.ts new file mode 100644 index 000000000..a83f2065b --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/app.ts @@ -0,0 +1,3 @@ +import { lib } from './lib'; + +console.log(lib.one, lib.two, lib.three); diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/bundle.js new file mode 100644 index 000000000..d01765a8e --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/bundle.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.helper = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\r\nexports.lib = {\r\n one: helper_1.helper.one,\r\n two: helper_1.helper.two,\r\n three: helper_1.helper.three\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/bundle.transpiled.js new file mode 100644 index 000000000..958994b3b --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/bundle.transpiled.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.helper = {\n one: 1,\n two: 2,\n three: 3\n};\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\nexports.lib = {\n one: helper_1.helper.one,\n two: helper_1.helper.two,\n three: helper_1.helper.three\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/output.transpiled.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/output.transpiled.txt new file mode 100644 index 000000000..af28e43ce --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/output.transpiled.txt @@ -0,0 +1,6 @@ + Asset Size Chunks Chunk Names +bundle.js 4.88 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 167 bytes {main} [built] +[./lib/helper.ts] 136 bytes {main} [built] +[./lib/index.ts] 225 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/output.txt new file mode 100644 index 000000000..82af8d6b7 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/output.txt @@ -0,0 +1,9 @@ + Asset Size Chunks Chunk Names + bundle.js 4.8 KiB main [emitted] main + ../lib/index.d.ts 89 bytes [emitted] + ../lib/helper.d.ts 92 bytes [emitted] +../lib/tsconfig.tsbuildinfo 71.4 KiB [emitted] +Entrypoint main = bundle.js +[./app.ts] 131 bytes {main} [built] +[./lib/helper.ts] 107 bytes {main} [built] +[./lib/index.ts] 197 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/bundle.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/bundle.js new file mode 100644 index 000000000..161ae86cc --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/bundle.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.helper = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\r\nexports.lib = {\r\n one: helper_1.helper.one,\r\n two: helper_1.helper.two,\r\n three: helper_1.helper.three,\r\n four: 4\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/bundle.transpiled.js new file mode 100644 index 000000000..b43d2a289 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/bundle.transpiled.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.helper = {\n one: 1,\n two: 2,\n three: 3\n};\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\nexports.lib = {\n one: helper_1.helper.one,\n two: helper_1.helper.two,\n three: helper_1.helper.three,\n four: 4\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/output.transpiled.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/output.transpiled.txt new file mode 100644 index 000000000..82d28664a --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/output.transpiled.txt @@ -0,0 +1,6 @@ + Asset Size Chunks Chunk Names +bundle.js 4.9 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 167 bytes {main} +[./lib/helper.ts] 136 bytes {main} +[./lib/index.ts] 238 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/output.txt new file mode 100644 index 000000000..68e7278b2 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch0/output.txt @@ -0,0 +1,8 @@ + Asset Size Chunks Chunk Names + bundle.js 4.82 KiB main [emitted] main + ../lib/index.d.ts 108 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.8 KiB [emitted] +Entrypoint main = bundle.js +[./app.ts] 131 bytes {main} [built] +[./lib/helper.ts] 107 bytes {main} +[./lib/index.ts] 211 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/bundle.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/bundle.js new file mode 100644 index 000000000..698126e22 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/bundle.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.helper = {\r\n one: 1,\r\n two: 2,\r\n three: 3,\r\n four: 4\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\r\nexports.lib = {\r\n one: helper_1.helper.one,\r\n two: helper_1.helper.two,\r\n three: helper_1.helper.three,\r\n four: 4\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/bundle.transpiled.js new file mode 100644 index 000000000..489621be1 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/bundle.transpiled.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.helper = {\n one: 1,\n two: 2,\n three: 3,\n four: 4\n};\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\nexports.lib = {\n one: helper_1.helper.one,\n two: helper_1.helper.two,\n three: helper_1.helper.three,\n four: 4\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/output.transpiled.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/output.transpiled.txt new file mode 100644 index 000000000..724ac0f9a --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/output.transpiled.txt @@ -0,0 +1,6 @@ + Asset Size Chunks Chunk Names +bundle.js 4.91 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 167 bytes {main} +[./lib/helper.ts] 149 bytes {main} [built] +[./lib/index.ts] 238 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/output.txt new file mode 100644 index 000000000..fe116fa10 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch1/output.txt @@ -0,0 +1,9 @@ + Asset Size Chunks Chunk Names + bundle.js 4.83 KiB main [emitted] main + ../lib/helper.d.ts 111 bytes [emitted] + ../lib/index.d.ts 108 bytes [emitted] +../lib/tsconfig.tsbuildinfo 68.8 KiB [emitted] +Entrypoint main = bundle.js +[./app.ts] 131 bytes {main} [built] +[./lib/helper.ts] 121 bytes {main} [built] +[./lib/index.ts] 211 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/bundle.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/bundle.js new file mode 100644 index 000000000..cf3fad706 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/bundle.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar helper_1 = __webpack_require__(/*! ./lib/helper */ \"./lib/helper.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, helper_1.helper.four); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.helper = {\r\n one: 1,\r\n two: 2,\r\n three: 3,\r\n four: 4\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\r\nexports.lib = {\r\n one: helper_1.helper.one,\r\n two: helper_1.helper.two,\r\n three: helper_1.helper.three,\r\n four: 4\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/bundle.transpiled.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/bundle.transpiled.js new file mode 100644 index 000000000..448f9dade --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/bundle.transpiled.js @@ -0,0 +1,125 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar helper_1 = __webpack_require__(/*! ./lib/helper */ \"./lib/helper.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three, helper_1.helper.four); // consume new number\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/helper.ts": +/*!***********************!*\ + !*** ./lib/helper.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.helper = {\n one: 1,\n two: 2,\n three: 3,\n four: 4\n};\n\n\n//# sourceURL=webpack:///./lib/helper.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helper_1 = __webpack_require__(/*! ./helper */ \"./lib/helper.ts\");\nexports.lib = {\n one: helper_1.helper.one,\n two: helper_1.helper.two,\n three: helper_1.helper.three,\n four: 4\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/output.transpiled.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/output.transpiled.txt new file mode 100644 index 000000000..c1c32140a --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/output.transpiled.txt @@ -0,0 +1,6 @@ + Asset Size Chunks Chunk Names +bundle.js 5.03 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 251 bytes {main} [built] +[./lib/helper.ts] 149 bytes {main} +[./lib/index.ts] 238 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/output.txt new file mode 100644 index 000000000..169e62679 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.6/patch2/output.txt @@ -0,0 +1,6 @@ + Asset Size Chunks Chunk Names +bundle.js 4.95 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 215 bytes {main} [built] +[./lib/helper.ts] 121 bytes {main} +[./lib/index.ts] 211 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/.gitignore b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/.gitignore new file mode 100644 index 000000000..7b7f62099 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/.gitignore @@ -0,0 +1 @@ +!*.js.map \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/helper.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/helper.ts new file mode 100644 index 000000000..4d0db74d4 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/helper.ts @@ -0,0 +1,5 @@ +export const helper = { + one: 1, + two: 2, + three: 3 +}; diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/index.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/index.ts new file mode 100644 index 000000000..0543e95fb --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/index.ts @@ -0,0 +1,6 @@ +import { helper } from './helper'; +export const lib = { + one: helper.one, + two: helper.two, + three: helper.three +}; diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/tsconfig.json b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/tsconfig.json new file mode 100644 index 000000000..97686f819 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/lib/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "composite": true, + "sourceMap": true + }, + "files": [ + "./index.ts", + "./helper.ts" + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/.gitignore b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/.gitignore new file mode 100644 index 000000000..7b7f62099 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/.gitignore @@ -0,0 +1 @@ +!*.js.map \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.d.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.d.ts new file mode 100644 index 000000000..ea0d91498 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.d.ts @@ -0,0 +1,5 @@ +export declare const helper: { + one: number; + two: number; + three: number; +}; diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.js new file mode 100644 index 000000000..5b98305e7 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.js @@ -0,0 +1,8 @@ +"use strict"; +exports.__esModule = true; +exports.helper = { + one: 1, + two: 2, + three: 3 +}; +//# sourceMappingURL=helper.js.map \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.js.map b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.js.map new file mode 100644 index 000000000..4b41c48c8 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/helper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helper.js","sourceRoot":"","sources":["helper.ts"],"names":[],"mappings":";;AAAa,QAAA,MAAM,GAAG;IAClB,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;CACX,CAAC"} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.d.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.d.ts new file mode 100644 index 000000000..73d752279 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.d.ts @@ -0,0 +1,5 @@ +export declare const lib: { + one: number; + two: number; + three: number; +}; diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.js new file mode 100644 index 000000000..b33c1bb5c --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.js @@ -0,0 +1,9 @@ +"use strict"; +exports.__esModule = true; +var helper_1 = require("./helper"); +exports.lib = { + one: helper_1.helper.one, + two: helper_1.helper.two, + three: helper_1.helper.three +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.js.map b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.js.map new file mode 100644 index 000000000..3a4e37b0f --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAAA,mCAAkC;AACrB,QAAA,GAAG,GAAG;IACjB,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,GAAG,EAAE,eAAM,CAAC,GAAG;IACf,KAAK,EAAE,eAAM,CAAC,KAAK;CACpB,CAAC"} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/tsconfig.tsbuildinfo b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/tsconfig.tsbuildinfo new file mode 100644 index 000000000..9ae72b1f5 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/libOutput/tsconfig.tsbuildinfo @@ -0,0 +1,1336 @@ +{ + "program": { + "fileInfos": { + "../../../../../../typescript/built/local/lib.d.ts": { + "version": "49ff9798f592c8b7e628fd881401e68810c1b3589ecd7a41b32b3c287374cde0", + "signature": "49ff9798f592c8b7e628fd881401e68810c1b3589ecd7a41b32b3c287374cde0" + }, + "../../../../../../typescript/built/local/lib.es5.d.ts": { + "version": "b908e2df0d8161203d89dd369a7a28166cca63b6aa63e852bbc498af06d8186f", + "signature": "b908e2df0d8161203d89dd369a7a28166cca63b6aa63e852bbc498af06d8186f" + }, + "../../../../../../typescript/built/local/lib.es2015.d.ts": { + "version": "7994d44005046d1413ea31d046577cdda33b8b2470f30281fd9c8b3c99fe2d96", + "signature": "7994d44005046d1413ea31d046577cdda33b8b2470f30281fd9c8b3c99fe2d96" + }, + "../../../../../../typescript/built/local/lib.es2016.d.ts": { + "version": "5f217838d25704474d9ef93774f04164889169ca31475fe423a9de6758f058d1", + "signature": "5f217838d25704474d9ef93774f04164889169ca31475fe423a9de6758f058d1" + }, + "../../../../../../typescript/built/local/lib.es2017.d.ts": { + "version": "459097c7bdd88fc5731367e56591e4f465f2c9de81a35427a7bd473165c34743", + "signature": "459097c7bdd88fc5731367e56591e4f465f2c9de81a35427a7bd473165c34743" + }, + "../../../../../../typescript/built/local/lib.es2018.d.ts": { + "version": "9c67dcc7ca897b61f58d57d487bc9f07950546e5ac8701cbc41a8a4fec48b091", + "signature": "9c67dcc7ca897b61f58d57d487bc9f07950546e5ac8701cbc41a8a4fec48b091" + }, + "../../../../../../typescript/built/local/lib.dom.d.ts": { + "version": "2d53f3741e5a4f78a90f623387d71a1cc809bb258f10cdaec034b67cbf71022f", + "signature": "2d53f3741e5a4f78a90f623387d71a1cc809bb258f10cdaec034b67cbf71022f" + }, + "../../../../../../typescript/built/local/lib.webworker.importscripts.d.ts": { + "version": "fe4e59403e34c7ff747abe4ff6abbc7718229556d7c1a5b93473fb53156c913b", + "signature": "fe4e59403e34c7ff747abe4ff6abbc7718229556d7c1a5b93473fb53156c913b" + }, + "../../../../../../typescript/built/local/lib.scripthost.d.ts": { + "version": "b9faa17292f17d2ad75e34fac77dd63a6403af1dba02d39cd0cbb9ffdf3de8b9", + "signature": "b9faa17292f17d2ad75e34fac77dd63a6403af1dba02d39cd0cbb9ffdf3de8b9" + }, + "../../../../../../typescript/built/local/lib.es2015.core.d.ts": { + "version": "734ddc145e147fbcd55f07d034f50ccff1086f5a880107665ec326fb368876f6", + "signature": "734ddc145e147fbcd55f07d034f50ccff1086f5a880107665ec326fb368876f6" + }, + "../../../../../../typescript/built/local/lib.es2015.collection.d.ts": { + "version": "4a0862a21f4700de873db3b916f70e41570e2f558da77d2087c9490f5a0615d8", + "signature": "4a0862a21f4700de873db3b916f70e41570e2f558da77d2087c9490f5a0615d8" + }, + "../../../../../../typescript/built/local/lib.es2015.generator.d.ts": { + "version": "765e0e9c9d74cf4d031ca8b0bdb269a853e7d81eda6354c8510218d03db12122", + "signature": "765e0e9c9d74cf4d031ca8b0bdb269a853e7d81eda6354c8510218d03db12122" + }, + "../../../../../../typescript/built/local/lib.es2015.iterable.d.ts": { + "version": "285958e7699f1babd76d595830207f18d719662a0c30fac7baca7df7162a9210", + "signature": "285958e7699f1babd76d595830207f18d719662a0c30fac7baca7df7162a9210" + }, + "../../../../../../typescript/built/local/lib.es2015.promise.d.ts": { + "version": "e6b8ff2798f8ebd7a1c7afd8671f2cb67ee1901c422f5964d74b0b34c6574ea2", + "signature": "e6b8ff2798f8ebd7a1c7afd8671f2cb67ee1901c422f5964d74b0b34c6574ea2" + }, + "../../../../../../typescript/built/local/lib.es2015.proxy.d.ts": { + "version": "5e72f949a89717db444e3bd9433468890068bb21a5638d8ab15a1359e05e54fe", + "signature": "5e72f949a89717db444e3bd9433468890068bb21a5638d8ab15a1359e05e54fe" + }, + "../../../../../../typescript/built/local/lib.es2015.reflect.d.ts": { + "version": "f5b242136ae9bfb1cc99a5971cccc44e99947ae6b5ef6fd8aa54b5ade553b976", + "signature": "f5b242136ae9bfb1cc99a5971cccc44e99947ae6b5ef6fd8aa54b5ade553b976" + }, + "../../../../../../typescript/built/local/lib.es2015.symbol.d.ts": { + "version": "9ae2860252d6b5f16e2026d8a2c2069db7b2a3295e98b6031d01337b96437230", + "signature": "9ae2860252d6b5f16e2026d8a2c2069db7b2a3295e98b6031d01337b96437230" + }, + "../../../../../../typescript/built/local/lib.es2015.symbol.wellknown.d.ts": { + "version": "3e0a459888f32b42138d5a39f706ff2d55d500ab1031e0988b5568b0f67c2303", + "signature": "3e0a459888f32b42138d5a39f706ff2d55d500ab1031e0988b5568b0f67c2303" + }, + "../../../../../../typescript/built/local/lib.es2016.array.include.d.ts": { + "version": "3f96f1e570aedbd97bf818c246727151e873125d0512e4ae904330286c721bc0", + "signature": "3f96f1e570aedbd97bf818c246727151e873125d0512e4ae904330286c721bc0" + }, + "../../../../../../typescript/built/local/lib.es2017.object.d.ts": { + "version": "c2d60b2e558d44384e4704b00e6b3d154334721a911f094d3133c35f0917b408", + "signature": "c2d60b2e558d44384e4704b00e6b3d154334721a911f094d3133c35f0917b408" + }, + "../../../../../../typescript/built/local/lib.es2017.sharedmemory.d.ts": { + "version": "b8667586a618c5cf64523d4e500ae39e781428abfb28f3de441fc66b56144b6f", + "signature": "b8667586a618c5cf64523d4e500ae39e781428abfb28f3de441fc66b56144b6f" + }, + "../../../../../../typescript/built/local/lib.es2017.string.d.ts": { + "version": "21df2e0059f14dcb4c3a0e125859f6b6ff01332ee24b0065a741d121250bc71c", + "signature": "21df2e0059f14dcb4c3a0e125859f6b6ff01332ee24b0065a741d121250bc71c" + }, + "../../../../../../typescript/built/local/lib.es2017.intl.d.ts": { + "version": "c1759cb171c7619af0d2234f2f8fb2a871ee88e956e2ed91bb61778e41f272c6", + "signature": "c1759cb171c7619af0d2234f2f8fb2a871ee88e956e2ed91bb61778e41f272c6" + }, + "../../../../../../typescript/built/local/lib.es2017.typedarrays.d.ts": { + "version": "28569d59e07d4378cb3d54979c4c60f9f06305c9bb6999ffe6cab758957adc46", + "signature": "28569d59e07d4378cb3d54979c4c60f9f06305c9bb6999ffe6cab758957adc46" + }, + "../../../../../../typescript/built/local/lib.es2018.asyncgenerator.d.ts": { + "version": "2958de3d25bfb0b5cdace0244e11c9637e5988920b99024db705a720ce6348e7", + "signature": "2958de3d25bfb0b5cdace0244e11c9637e5988920b99024db705a720ce6348e7" + }, + "../../../../../../typescript/built/local/lib.es2018.asynciterable.d.ts": { + "version": "85085a0783532dc04b66894748dc4a49983b2fbccb0679b81356947021d7a215", + "signature": "85085a0783532dc04b66894748dc4a49983b2fbccb0679b81356947021d7a215" + }, + "../../../../../../typescript/built/local/lib.es2018.intl.d.ts": { + "version": "5494f46d3a8a0329d13ddc37f8759d5288760febb51c92336608d1c06bb18d29", + "signature": "5494f46d3a8a0329d13ddc37f8759d5288760febb51c92336608d1c06bb18d29" + }, + "../../../../../../typescript/built/local/lib.es2018.promise.d.ts": { + "version": "efe049114bad1035b0aa9a4a0359f50ab776e3897c411521e51d3013079cbd62", + "signature": "efe049114bad1035b0aa9a4a0359f50ab776e3897c411521e51d3013079cbd62" + }, + "../../../../../../typescript/built/local/lib.es2018.regexp.d.ts": { + "version": "e7780d04cd4120ee554c665829db2bbdd6b947cbaa3c150b7d9ea74df3beb2e8", + "signature": "e7780d04cd4120ee554c665829db2bbdd6b947cbaa3c150b7d9ea74df3beb2e8" + }, + "../../../../../../typescript/built/local/lib.esnext.intl.d.ts": { + "version": "1377923021927244ea19433873b997ad8585533b0a56d5de29cda497f7842756", + "signature": "1377923021927244ea19433873b997ad8585533b0a56d5de29cda497f7842756" + }, + "../../../../../../typescript/built/local/lib.esnext.bigint.d.ts": { + "version": "0c9ea8c2028047f39a3f66752682604f543c08be8806258c3d95c93e75a43255", + "signature": "0c9ea8c2028047f39a3f66752682604f543c08be8806258c3d95c93e75a43255" + }, + "./helper.ts": { + "version": "bd8500a78d56a07c2de3c8c735ca2ea8bfba63861da1c1e6a77f96ac5526c238", + "signature": "affd04424229ba34162d389ba65c55af2f176324c07a2225509909a216b2b7b1" + }, + "./index.ts": { + "version": "bc4ed2b009cdf5f131d46c0ab70386155058ea9011c613bdf82b0b16dae6fa1c", + "signature": "0dd99d92de87be28f815ef57f516fb62cd7482c63a363827f154cf0821eaaf48" + }, + "../../../../node_modules/@types/anymatch/index.d.ts": { + "version": "48b52264fa193879a074197839dbb4796fa07e86350ff888e5361e06aa46df76", + "signature": "48b52264fa193879a074197839dbb4796fa07e86350ff888e5361e06aa46df76" + }, + "../../../../node_modules/@types/braces/index.d.ts": { + "version": "90b8546eff85ca8f4358d2bb3b01bdf53f8411a5ffa1099639bb3162acd87dc2", + "signature": "90b8546eff85ca8f4358d2bb3b01bdf53f8411a5ffa1099639bb3162acd87dc2" + }, + "../../../../node_modules/@types/micromatch/index.d.ts": { + "version": "af1ce94e5c3d99a5bd4d91d53555d2e58c1a60adc5a8a719d1f8fe25d3dad91b", + "signature": "af1ce94e5c3d99a5bd4d91d53555d2e58c1a60adc5a8a719d1f8fe25d3dad91b" + }, + "../../../../node_modules/@types/node/globals.d.ts": { + "version": "3af134c0480536f901a30692d216bd29712a3869fe38a7be066ea1eef34a8561", + "signature": "3af134c0480536f901a30692d216bd29712a3869fe38a7be066ea1eef34a8561" + }, + "../../../../node_modules/@types/node/assert.d.ts": { + "version": "58a52f282f1dad18179023804c1f3a7536bf875748a0a314abd43f60fd5b244f", + "signature": "58a52f282f1dad18179023804c1f3a7536bf875748a0a314abd43f60fd5b244f" + }, + "../../../../node_modules/@types/node/async_hooks.d.ts": { + "version": "1305b079a057355f496bdde048716189178877a6b4fe0e9267a46af67f8c7561", + "signature": "1305b079a057355f496bdde048716189178877a6b4fe0e9267a46af67f8c7561" + }, + "../../../../node_modules/@types/node/buffer.d.ts": { + "version": "fe892fea1e75a442fffb4a604d7eeb451e858787a9f2f01c4e83bf12a3b5048d", + "signature": "fe892fea1e75a442fffb4a604d7eeb451e858787a9f2f01c4e83bf12a3b5048d" + }, + "../../../../node_modules/@types/node/child_process.d.ts": { + "version": "c5a3c14cb11afb48d405562e6843145caa67c60be9738f408cd7977ce30a0b00", + "signature": "c5a3c14cb11afb48d405562e6843145caa67c60be9738f408cd7977ce30a0b00" + }, + "../../../../node_modules/@types/node/cluster.d.ts": { + "version": "ce629710e5e58724902b753212e97861fd73e2aa09f5d88cb6d55dc763cf8c8a", + "signature": "ce629710e5e58724902b753212e97861fd73e2aa09f5d88cb6d55dc763cf8c8a" + }, + "../../../../node_modules/@types/node/console.d.ts": { + "version": "525c8fc510d9632d2a0a9de2d41c3ac1cdd79ff44d3b45c6d81cacabb683528d", + "signature": "525c8fc510d9632d2a0a9de2d41c3ac1cdd79ff44d3b45c6d81cacabb683528d" + }, + "../../../../node_modules/@types/node/constants.d.ts": { + "version": "b952021e804dcd9cb5e5552e1ec8bf9f479b61e20da5641e2a542fe77db9a598", + "signature": "b952021e804dcd9cb5e5552e1ec8bf9f479b61e20da5641e2a542fe77db9a598" + }, + "../../../../node_modules/@types/node/crypto.d.ts": { + "version": "a9ccdfa12ea56a5dc82a34df1820f820934ebb8af0f96324952be06e7484201f", + "signature": "a9ccdfa12ea56a5dc82a34df1820f820934ebb8af0f96324952be06e7484201f" + }, + "../../../../node_modules/@types/node/dgram.d.ts": { + "version": "b6c6861bccf209a98eeddb99bdb7bd987fb29fc52130d5d9fd2f79d3607a0a7a", + "signature": "b6c6861bccf209a98eeddb99bdb7bd987fb29fc52130d5d9fd2f79d3607a0a7a" + }, + "../../../../node_modules/@types/node/dns.d.ts": { + "version": "896cd7d58e9d832392a6e374a8f8b64f142089b4d2678a2c90fd8d1d49128677", + "signature": "896cd7d58e9d832392a6e374a8f8b64f142089b4d2678a2c90fd8d1d49128677" + }, + "../../../../node_modules/@types/node/domain.d.ts": { + "version": "d5b7c8819ce1bd31a45f7675309e145ec28e3aa1b60a8e0637fd0e8916255baa", + "signature": "d5b7c8819ce1bd31a45f7675309e145ec28e3aa1b60a8e0637fd0e8916255baa" + }, + "../../../../node_modules/@types/node/events.d.ts": { + "version": "0be551fde848d5adde38731272ee980bda2bde0f8bf2a76ce99e01b86985546c", + "signature": "0be551fde848d5adde38731272ee980bda2bde0f8bf2a76ce99e01b86985546c" + }, + "../../../../node_modules/@types/node/fs.d.ts": { + "version": "10c5b29dccf29ea7f9aea324ab09b0e2237d6506bd8e28538963b28855819616", + "signature": "10c5b29dccf29ea7f9aea324ab09b0e2237d6506bd8e28538963b28855819616" + }, + "../../../../node_modules/@types/node/http.d.ts": { + "version": "cc4cd9d8af7f5689b5df3c91d0fc287fafbd89e6e305183da28a6877a8aa08a8", + "signature": "cc4cd9d8af7f5689b5df3c91d0fc287fafbd89e6e305183da28a6877a8aa08a8" + }, + "../../../../node_modules/@types/node/http2.d.ts": { + "version": "28fdca6c7a3d5dd62c738461051ef345b50d167efab39dceb2fcc9a079db1b07", + "signature": "28fdca6c7a3d5dd62c738461051ef345b50d167efab39dceb2fcc9a079db1b07" + }, + "../../../../node_modules/@types/node/https.d.ts": { + "version": "dacbe08610729f6343ea9880ea8e737c6d7a6efa4a318d8f6acaf85db4aceed6", + "signature": "dacbe08610729f6343ea9880ea8e737c6d7a6efa4a318d8f6acaf85db4aceed6" + }, + "../../../../node_modules/@types/node/inspector.d.ts": { + "version": "7f71142177d3c98370b31751e3d320c9743ed28eee215acb88d8e0d2a31e321e", + "signature": "7f71142177d3c98370b31751e3d320c9743ed28eee215acb88d8e0d2a31e321e" + }, + "../../../../node_modules/@types/node/module.d.ts": { + "version": "03394bf8deb8781b490ae9266a843fbdf00647947d79e25fcbf1d89a9e9c8a66", + "signature": "03394bf8deb8781b490ae9266a843fbdf00647947d79e25fcbf1d89a9e9c8a66" + }, + "../../../../node_modules/@types/node/net.d.ts": { + "version": "cc5fac2b9e45a6670b96fd32cb42c97e0d4a7b2ee12c87963c6fe0f55fa84f50", + "signature": "cc5fac2b9e45a6670b96fd32cb42c97e0d4a7b2ee12c87963c6fe0f55fa84f50" + }, + "../../../../node_modules/@types/node/os.d.ts": { + "version": "1a6016bd905855b2b45881e9edbd7ab8c7175f8bcbb711ff06989c4bcdc75486", + "signature": "1a6016bd905855b2b45881e9edbd7ab8c7175f8bcbb711ff06989c4bcdc75486" + }, + "../../../../node_modules/@types/node/path.d.ts": { + "version": "5fb30076f0e0e5744db8993648bfb67aadd895f439edad5cce039127a87a8a36", + "signature": "5fb30076f0e0e5744db8993648bfb67aadd895f439edad5cce039127a87a8a36" + }, + "../../../../node_modules/@types/node/perf_hooks.d.ts": { + "version": "27ef4001526ee9d8afa57687a60bb3b59c52b32d29db0a2260094ab64726164f", + "signature": "27ef4001526ee9d8afa57687a60bb3b59c52b32d29db0a2260094ab64726164f" + }, + "../../../../node_modules/@types/node/process.d.ts": { + "version": "3a8848a9c307429b861402cc69bc472ffe0c05b86474fc158723169161e16389", + "signature": "3a8848a9c307429b861402cc69bc472ffe0c05b86474fc158723169161e16389" + }, + "../../../../node_modules/@types/node/punycode.d.ts": { + "version": "30ec6f9c683b988c3cfaa0c4690692049c4e7ed7dc6f6e94f56194c06b86f5e1", + "signature": "30ec6f9c683b988c3cfaa0c4690692049c4e7ed7dc6f6e94f56194c06b86f5e1" + }, + "../../../../node_modules/@types/node/querystring.d.ts": { + "version": "b610b39b7d42b8e8359875ce77c3149d657bbaa6c9058beb655af805efb581b3", + "signature": "b610b39b7d42b8e8359875ce77c3149d657bbaa6c9058beb655af805efb581b3" + }, + "../../../../node_modules/@types/node/readline.d.ts": { + "version": "94cf93922adcc9cb4acf11d8d71641af728de919a50ae55d8e83159afea1a42c", + "signature": "94cf93922adcc9cb4acf11d8d71641af728de919a50ae55d8e83159afea1a42c" + }, + "../../../../node_modules/@types/node/repl.d.ts": { + "version": "65dbe15ed8a8ed5d4707a63868178dc38111cfc06de28a2e50713ca017a9c157", + "signature": "65dbe15ed8a8ed5d4707a63868178dc38111cfc06de28a2e50713ca017a9c157" + }, + "../../../../node_modules/@types/node/stream.d.ts": { + "version": "15087156b728a1bdf46de0e1299f904c6a658af37f80851f6fe76fb21bb99b65", + "signature": "15087156b728a1bdf46de0e1299f904c6a658af37f80851f6fe76fb21bb99b65" + }, + "../../../../node_modules/@types/node/string_decoder.d.ts": { + "version": "17e157df6125098a1a34eb4d201ee4ac03bbe97e471ab5627bb2c40fce555948", + "signature": "17e157df6125098a1a34eb4d201ee4ac03bbe97e471ab5627bb2c40fce555948" + }, + "../../../../node_modules/@types/node/timers.d.ts": { + "version": "b40652bf8ce4a18133b31349086523b219724dca8df3448c1a0742528e7ad5b9", + "signature": "b40652bf8ce4a18133b31349086523b219724dca8df3448c1a0742528e7ad5b9" + }, + "../../../../node_modules/@types/node/tls.d.ts": { + "version": "8fd6756e8a6fac64089e19e4fbe822bcfafa62f79b237172288eaa1379e84083", + "signature": "8fd6756e8a6fac64089e19e4fbe822bcfafa62f79b237172288eaa1379e84083" + }, + "../../../../node_modules/@types/node/trace_events.d.ts": { + "version": "978aecd2e6bc2ac094e9a35eda98ff8586713857b3655e7c98ca5ed8f7d50662", + "signature": "978aecd2e6bc2ac094e9a35eda98ff8586713857b3655e7c98ca5ed8f7d50662" + }, + "../../../../node_modules/@types/node/tty.d.ts": { + "version": "0fd8dac24f12d9fd1fcc275200dd1b6771072f20331a07b18f7dbcbe20f7d3f4", + "signature": "0fd8dac24f12d9fd1fcc275200dd1b6771072f20331a07b18f7dbcbe20f7d3f4" + }, + "../../../../node_modules/@types/node/url.d.ts": { + "version": "1e3da92862604b1f7a32265169f9aa712c4567742d42597704e04ae3e07019e7", + "signature": "1e3da92862604b1f7a32265169f9aa712c4567742d42597704e04ae3e07019e7" + }, + "../../../../node_modules/@types/node/util.d.ts": { + "version": "0f6382d5032e45eec50b8f6c1e18c77544bc4db2ef8f854d196b254ec16add12", + "signature": "0f6382d5032e45eec50b8f6c1e18c77544bc4db2ef8f854d196b254ec16add12" + }, + "../../../../node_modules/@types/node/v8.d.ts": { + "version": "6ad2dd29dbf3aea031062298e9978d4b2a1fadd0997eb9d8caaf95aaa89e7033", + "signature": "6ad2dd29dbf3aea031062298e9978d4b2a1fadd0997eb9d8caaf95aaa89e7033" + }, + "../../../../node_modules/@types/node/vm.d.ts": { + "version": "f98df5ec124f441b465332271d0b083aeec815cd3c92d9249b9739e6318477a9", + "signature": "f98df5ec124f441b465332271d0b083aeec815cd3c92d9249b9739e6318477a9" + }, + "../../../../node_modules/@types/node/worker_threads.d.ts": { + "version": "16de20ae20cd1d948409a56b55832f3d416c66c8cb44bb8475e1e9db14d8e402", + "signature": "16de20ae20cd1d948409a56b55832f3d416c66c8cb44bb8475e1e9db14d8e402" + }, + "../../../../node_modules/@types/node/zlib.d.ts": { + "version": "f91189e04264b0e41ee96ff96661c3871e739b90156df2f2288da7a81019dcd9", + "signature": "f91189e04264b0e41ee96ff96661c3871e739b90156df2f2288da7a81019dcd9" + }, + "../../../../node_modules/@types/node/base.d.ts": { + "version": "6622f76993bdfeaacb947ba7c4cf26f2e5c5194194d02d792c3cba4174cd8fce", + "signature": "6622f76993bdfeaacb947ba7c4cf26f2e5c5194194d02d792c3cba4174cd8fce" + }, + "../../../../node_modules/@types/node/ts3.2/util.d.ts": { + "version": "4f54f0a9dd3b644c99ec32b32f8804d5978bc854799b228ae9c467bf3c84c64c", + "signature": "4f54f0a9dd3b644c99ec32b32f8804d5978bc854799b228ae9c467bf3c84c64c" + }, + "../../../../node_modules/@types/node/ts3.2/globals.d.ts": { + "version": "4926e99d2ad39c0bbd36f2d37cc8f52756bc7a5661ad7b12815df871a4b07ba1", + "signature": "4926e99d2ad39c0bbd36f2d37cc8f52756bc7a5661ad7b12815df871a4b07ba1" + }, + "../../../../node_modules/@types/node/ts3.2/index.d.ts": { + "version": "765fc34423b93c2ab763670d8d11d99e5f47387c13c161d6f1640dd6d91b7d1c", + "signature": "765fc34423b93c2ab763670d8d11d99e5f47387c13c161d6f1640dd6d91b7d1c" + }, + "../../../../node_modules/@types/normalize-package-data/index.d.ts": { + "version": "c9ad058b2cc9ce6dc2ed92960d6d009e8c04bef46d3f5312283debca6869f613", + "signature": "c9ad058b2cc9ce6dc2ed92960d6d009e8c04bef46d3f5312283debca6869f613" + }, + "../../../../node_modules/@types/semver/index.d.ts": { + "version": "053f38a8646cb2b1316e1a79c918b32b62ceb0758417fb087b2a05010ba9cc0c", + "signature": "053f38a8646cb2b1316e1a79c918b32b62ceb0758417fb087b2a05010ba9cc0c" + }, + "../../../../node_modules/@types/tapable/index.d.ts": { + "version": "c3175d4a7894de56cdc5e62f4269f1f57c2f08da88d3a91ad47bc0652ac8cb46", + "signature": "c3175d4a7894de56cdc5e62f4269f1f57c2f08da88d3a91ad47bc0652ac8cb46" + }, + "../../../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts": { + "version": "2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579", + "signature": "2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579" + }, + "../../../../node_modules/@types/uglify-js/index.d.ts": { + "version": "bdc18dd47aea9977e419a8e03e7e5d04ed8cf8265e014d8788848b76b969cbba", + "signature": "bdc18dd47aea9977e419a8e03e7e5d04ed8cf8265e014d8788848b76b969cbba" + }, + "../../../../node_modules/@types/webpack/node_modules/source-map/source-map.d.ts": { + "version": "2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579", + "signature": "2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579" + }, + "../../../../node_modules/@types/webpack/index.d.ts": { + "version": "ce4ec2f508914034bb1f6dc45f2bc26f157549a65a045328fc50a743d05be0c9", + "signature": "ce4ec2f508914034bb1f6dc45f2bc26f157549a65a045328fc50a743d05be0c9" + } + }, + "options": { + "composite": true, + "sourceMap": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../../../../../../typescript/built/local/lib.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es5.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2016.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.dom.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.webworker.importscripts.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.scripthost.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.core.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.collection.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.generator.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.iterable.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.promise.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.proxy.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.reflect.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.symbol.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.symbol.wellknown.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2016.array.include.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.object.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.sharedmemory.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.string.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.intl.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.typedarrays.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.asyncgenerator.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.asynciterable.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.intl.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.promise.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.regexp.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.esnext.intl.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.esnext.bigint.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "./helper.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "./index.ts": [ + "./helper.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/anymatch/index.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/braces/index.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/micromatch/index.d.ts": [ + "../../../../node_modules/@types/braces/index.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/globals.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/assert.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/async_hooks.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/buffer.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/child_process.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/cluster.d.ts": [ + "../../../../node_modules/@types/node/child_process.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/console.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/constants.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/crypto.d.ts": [ + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/dgram.d.ts": [ + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/dns.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/dns.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/domain.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/events.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/fs.d.ts": [ + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/url.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/http.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/url.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/http2.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/fs.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/tls.d.ts", + "../../../../node_modules/@types/node/url.d.ts", + "../../../../node_modules/@types/node/http.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/https.d.ts": [ + "../../../../node_modules/@types/node/tls.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/http.d.ts", + "../../../../node_modules/@types/node/url.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/inspector.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/module.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/net.d.ts": [ + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/dns.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/os.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/path.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/perf_hooks.d.ts": [ + "../../../../node_modules/@types/node/async_hooks.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/process.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/punycode.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/querystring.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/readline.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/repl.d.ts": [ + "../../../../node_modules/@types/node/readline.d.ts", + "../../../../node_modules/@types/node/vm.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/stream.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/string_decoder.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/timers.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/tls.d.ts": [ + "../../../../node_modules/@types/node/crypto.d.ts", + "../../../../node_modules/@types/node/dns.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/trace_events.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/tty.d.ts": [ + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/url.d.ts": [ + "../../../../node_modules/@types/node/querystring.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/util.d.ts": [ + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/v8.d.ts": [ + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/vm.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/worker_threads.d.ts": [ + "../../../../node_modules/@types/node/vm.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/zlib.d.ts": [ + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/base.d.ts": [ + "../../../../node_modules/@types/node/globals.d.ts", + "../../../../node_modules/@types/node/assert.d.ts", + "../../../../node_modules/@types/node/async_hooks.d.ts", + "../../../../node_modules/@types/node/buffer.d.ts", + "../../../../node_modules/@types/node/child_process.d.ts", + "../../../../node_modules/@types/node/cluster.d.ts", + "../../../../node_modules/@types/node/console.d.ts", + "../../../../node_modules/@types/node/constants.d.ts", + "../../../../node_modules/@types/node/crypto.d.ts", + "../../../../node_modules/@types/node/dgram.d.ts", + "../../../../node_modules/@types/node/dns.d.ts", + "../../../../node_modules/@types/node/domain.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/fs.d.ts", + "../../../../node_modules/@types/node/http.d.ts", + "../../../../node_modules/@types/node/http2.d.ts", + "../../../../node_modules/@types/node/https.d.ts", + "../../../../node_modules/@types/node/inspector.d.ts", + "../../../../node_modules/@types/node/module.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/os.d.ts", + "../../../../node_modules/@types/node/path.d.ts", + "../../../../node_modules/@types/node/perf_hooks.d.ts", + "../../../../node_modules/@types/node/process.d.ts", + "../../../../node_modules/@types/node/punycode.d.ts", + "../../../../node_modules/@types/node/querystring.d.ts", + "../../../../node_modules/@types/node/readline.d.ts", + "../../../../node_modules/@types/node/repl.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/string_decoder.d.ts", + "../../../../node_modules/@types/node/timers.d.ts", + "../../../../node_modules/@types/node/tls.d.ts", + "../../../../node_modules/@types/node/trace_events.d.ts", + "../../../../node_modules/@types/node/tty.d.ts", + "../../../../node_modules/@types/node/url.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/v8.d.ts", + "../../../../node_modules/@types/node/vm.d.ts", + "../../../../node_modules/@types/node/worker_threads.d.ts", + "../../../../node_modules/@types/node/zlib.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/ts3.2/util.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts" + ], + "../../../../node_modules/@types/node/ts3.2/globals.d.ts": [ + "../../../../node_modules/@types/node/globals.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/ts3.2/index.d.ts": [ + "../../../../node_modules/@types/node/base.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/globals.d.ts", + "../../../../node_modules/@types/node/util.d.ts" + ], + "../../../../node_modules/@types/normalize-package-data/index.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/semver/index.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/tapable/index.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/uglify-js/index.d.ts": [ + "../../../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/webpack/node_modules/source-map/source-map.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/webpack/index.d.ts": [ + "../../../../node_modules/@types/tapable/index.d.ts", + "../../../../node_modules/@types/uglify-js/index.d.ts", + "../../../../node_modules/@types/anymatch/index.d.ts", + "../../../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts", + "../../../../node_modules/@types/node/ts3.2/index.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ] + }, + "exportedModulesMap": { + "../../../../../../typescript/built/local/lib.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es5.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2016.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.dom.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.webworker.importscripts.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.scripthost.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.core.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.collection.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.generator.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.iterable.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.promise.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.proxy.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.reflect.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.symbol.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2015.symbol.wellknown.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2016.array.include.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.object.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.sharedmemory.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.string.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.intl.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2017.typedarrays.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.asyncgenerator.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.asynciterable.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.intl.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.promise.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.es2018.regexp.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.esnext.intl.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../../../typescript/built/local/lib.esnext.bigint.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/anymatch/index.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/webpack/index.d.ts": [ + "../../../../node_modules/@types/tapable/index.d.ts", + "../../../../node_modules/@types/uglify-js/index.d.ts", + "../../../../node_modules/@types/anymatch/index.d.ts", + "../../../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts", + "../../../../node_modules/@types/node/ts3.2/index.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/braces/index.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/micromatch/index.d.ts": [ + "../../../../node_modules/@types/braces/index.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/globals.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/assert.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/base.d.ts": [ + "../../../../node_modules/@types/node/globals.d.ts", + "../../../../node_modules/@types/node/assert.d.ts", + "../../../../node_modules/@types/node/async_hooks.d.ts", + "../../../../node_modules/@types/node/buffer.d.ts", + "../../../../node_modules/@types/node/child_process.d.ts", + "../../../../node_modules/@types/node/cluster.d.ts", + "../../../../node_modules/@types/node/console.d.ts", + "../../../../node_modules/@types/node/constants.d.ts", + "../../../../node_modules/@types/node/crypto.d.ts", + "../../../../node_modules/@types/node/dgram.d.ts", + "../../../../node_modules/@types/node/dns.d.ts", + "../../../../node_modules/@types/node/domain.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/fs.d.ts", + "../../../../node_modules/@types/node/http.d.ts", + "../../../../node_modules/@types/node/http2.d.ts", + "../../../../node_modules/@types/node/https.d.ts", + "../../../../node_modules/@types/node/inspector.d.ts", + "../../../../node_modules/@types/node/module.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/os.d.ts", + "../../../../node_modules/@types/node/path.d.ts", + "../../../../node_modules/@types/node/perf_hooks.d.ts", + "../../../../node_modules/@types/node/process.d.ts", + "../../../../node_modules/@types/node/punycode.d.ts", + "../../../../node_modules/@types/node/querystring.d.ts", + "../../../../node_modules/@types/node/readline.d.ts", + "../../../../node_modules/@types/node/repl.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/string_decoder.d.ts", + "../../../../node_modules/@types/node/timers.d.ts", + "../../../../node_modules/@types/node/tls.d.ts", + "../../../../node_modules/@types/node/trace_events.d.ts", + "../../../../node_modules/@types/node/tty.d.ts", + "../../../../node_modules/@types/node/url.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/v8.d.ts", + "../../../../node_modules/@types/node/vm.d.ts", + "../../../../node_modules/@types/node/worker_threads.d.ts", + "../../../../node_modules/@types/node/zlib.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/ts3.2/index.d.ts": [ + "../../../../node_modules/@types/node/base.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/globals.d.ts", + "../../../../node_modules/@types/node/util.d.ts" + ], + "../../../../node_modules/@types/node/async_hooks.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/perf_hooks.d.ts": [ + "../../../../node_modules/@types/node/async_hooks.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/buffer.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/child_process.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/cluster.d.ts": [ + "../../../../node_modules/@types/node/child_process.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/console.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/constants.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/crypto.d.ts": [ + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/tls.d.ts": [ + "../../../../node_modules/@types/node/crypto.d.ts", + "../../../../node_modules/@types/node/dns.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/https.d.ts": [ + "../../../../node_modules/@types/node/tls.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/http.d.ts", + "../../../../node_modules/@types/node/url.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/http2.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/fs.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/tls.d.ts", + "../../../../node_modules/@types/node/url.d.ts", + "../../../../node_modules/@types/node/http.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/dgram.d.ts": [ + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/dns.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/dns.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/net.d.ts": [ + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/dns.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/tty.d.ts": [ + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/http.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/url.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/domain.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/events.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/worker_threads.d.ts": [ + "../../../../node_modules/@types/node/vm.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/stream.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/zlib.d.ts": [ + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/v8.d.ts": [ + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/readline.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/repl.d.ts": [ + "../../../../node_modules/@types/node/readline.d.ts", + "../../../../node_modules/@types/node/vm.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/fs.d.ts": [ + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/url.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/inspector.d.ts": [ + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/module.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/os.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/path.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/process.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/punycode.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/querystring.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/url.d.ts": [ + "../../../../node_modules/@types/node/querystring.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/string_decoder.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/timers.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/trace_events.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/util.d.ts": [ + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/webpack/node_modules/source-map/source-map.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/uglify-js/index.d.ts": [ + "../../../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/tapable/index.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/semver/index.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/normalize-package-data/index.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/ts3.2/globals.d.ts": [ + "../../../../node_modules/@types/node/globals.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../../../../node_modules/@types/node/ts3.2/util.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts" + ], + "../../../../node_modules/@types/node/vm.d.ts": [ + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../../typescript/built/local/lib.d.ts", + "./helper.ts", + "./index.ts", + "../../../../node_modules/@types/anymatch/index.d.ts", + "../../../../node_modules/@types/braces/index.d.ts", + "../../../../node_modules/@types/micromatch/index.d.ts", + "../../../../node_modules/@types/node/globals.d.ts", + "../../../../node_modules/@types/node/assert.d.ts", + "../../../../node_modules/@types/node/async_hooks.d.ts", + "../../../../node_modules/@types/node/buffer.d.ts", + "../../../../node_modules/@types/node/child_process.d.ts", + "../../../../node_modules/@types/node/cluster.d.ts", + "../../../../node_modules/@types/node/console.d.ts", + "../../../../node_modules/@types/node/constants.d.ts", + "../../../../node_modules/@types/node/crypto.d.ts", + "../../../../node_modules/@types/node/dgram.d.ts", + "../../../../node_modules/@types/node/dns.d.ts", + "../../../../node_modules/@types/node/domain.d.ts", + "../../../../node_modules/@types/node/events.d.ts", + "../../../../node_modules/@types/node/fs.d.ts", + "../../../../node_modules/@types/node/http.d.ts", + "../../../../node_modules/@types/node/http2.d.ts", + "../../../../node_modules/@types/node/https.d.ts", + "../../../../node_modules/@types/node/inspector.d.ts", + "../../../../node_modules/@types/node/module.d.ts", + "../../../../node_modules/@types/node/net.d.ts", + "../../../../node_modules/@types/node/os.d.ts", + "../../../../node_modules/@types/node/path.d.ts", + "../../../../node_modules/@types/node/perf_hooks.d.ts", + "../../../../node_modules/@types/node/process.d.ts", + "../../../../node_modules/@types/node/punycode.d.ts", + "../../../../node_modules/@types/node/querystring.d.ts", + "../../../../node_modules/@types/node/readline.d.ts", + "../../../../node_modules/@types/node/repl.d.ts", + "../../../../node_modules/@types/node/stream.d.ts", + "../../../../node_modules/@types/node/string_decoder.d.ts", + "../../../../node_modules/@types/node/timers.d.ts", + "../../../../node_modules/@types/node/tls.d.ts", + "../../../../node_modules/@types/node/trace_events.d.ts", + "../../../../node_modules/@types/node/tty.d.ts", + "../../../../node_modules/@types/node/url.d.ts", + "../../../../node_modules/@types/node/util.d.ts", + "../../../../node_modules/@types/node/v8.d.ts", + "../../../../node_modules/@types/node/vm.d.ts", + "../../../../node_modules/@types/node/worker_threads.d.ts", + "../../../../node_modules/@types/node/zlib.d.ts", + "../../../../node_modules/@types/node/base.d.ts", + "../../../../node_modules/@types/node/ts3.2/util.d.ts", + "../../../../node_modules/@types/node/ts3.2/globals.d.ts", + "../../../../node_modules/@types/node/ts3.2/index.d.ts", + "../../../../node_modules/@types/normalize-package-data/index.d.ts", + "../../../../node_modules/@types/semver/index.d.ts", + "../../../../node_modules/@types/tapable/index.d.ts", + "../../../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts", + "../../../../node_modules/@types/uglify-js/index.d.ts", + "../../../../node_modules/@types/webpack/node_modules/source-map/source-map.d.ts", + "../../../../node_modules/@types/webpack/index.d.ts", + "../../../../../../typescript/built/local/lib.es2015.d.ts", + "../../../../../../typescript/built/local/lib.es2016.d.ts", + "../../../../../../typescript/built/local/lib.es2017.d.ts", + "../../../../../../typescript/built/local/lib.es2018.d.ts", + "../../../../../../typescript/built/local/lib.esnext.bigint.d.ts", + "../../../../../../typescript/built/local/lib.esnext.intl.d.ts", + "../../../../../../typescript/built/local/lib.es2018.regexp.d.ts", + "../../../../../../typescript/built/local/lib.es2018.promise.d.ts", + "../../../../../../typescript/built/local/lib.es2018.intl.d.ts", + "../../../../../../typescript/built/local/lib.es2018.asynciterable.d.ts", + "../../../../../../typescript/built/local/lib.es2018.asyncgenerator.d.ts", + "../../../../../../typescript/built/local/lib.es2017.typedarrays.d.ts", + "../../../../../../typescript/built/local/lib.es2017.intl.d.ts", + "../../../../../../typescript/built/local/lib.es2017.string.d.ts", + "../../../../../../typescript/built/local/lib.es2017.sharedmemory.d.ts", + "../../../../../../typescript/built/local/lib.es2017.object.d.ts", + "../../../../../../typescript/built/local/lib.es2016.array.include.d.ts", + "../../../../../../typescript/built/local/lib.es2015.symbol.wellknown.d.ts", + "../../../../../../typescript/built/local/lib.es2015.symbol.d.ts", + "../../../../../../typescript/built/local/lib.es2015.reflect.d.ts", + "../../../../../../typescript/built/local/lib.es2015.proxy.d.ts", + "../../../../../../typescript/built/local/lib.es2015.promise.d.ts", + "../../../../../../typescript/built/local/lib.es2015.iterable.d.ts", + "../../../../../../typescript/built/local/lib.es2015.generator.d.ts", + "../../../../../../typescript/built/local/lib.es2015.collection.d.ts", + "../../../../../../typescript/built/local/lib.es2015.core.d.ts", + "../../../../../../typescript/built/local/lib.scripthost.d.ts", + "../../../../../../typescript/built/local/lib.webworker.importscripts.d.ts", + "../../../../../../typescript/built/local/lib.dom.d.ts", + "../../../../../../typescript/built/local/lib.es5.d.ts" + ] + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch0/lib/index.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch0/lib/index.ts new file mode 100644 index 000000000..7d627c095 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch0/lib/index.ts @@ -0,0 +1,7 @@ +import { helper } from './helper'; +export const lib = { + one: helper.one, + two: helper.two, + three: helper.three, + four: 4 +}; diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch1/lib/helper.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch1/lib/helper.ts new file mode 100644 index 000000000..7538d158b --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch1/lib/helper.ts @@ -0,0 +1,6 @@ +export const helper = { + one: 1, + two: 2, + three: 3, + four: 4 +}; diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch2/app.ts b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch2/app.ts new file mode 100644 index 000000000..991614300 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/patch2/app.ts @@ -0,0 +1,4 @@ +import { lib } from './lib'; +import { helper } from './lib/helper'; + +console.log(lib.one, lib.two, lib.three, helper.four); // consume new number diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/tsconfig.json b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/tsconfig.json new file mode 100644 index 000000000..6d9798ff7 --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/tsconfig.json @@ -0,0 +1,8 @@ +{ +"files": [ + "./app.ts" + ], + "references": [ + { "path": "./lib" } + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/webpack.config.js b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/webpack.config.js new file mode 100644 index 000000000..7c1c875fe --- /dev/null +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/webpack.config.js @@ -0,0 +1,18 @@ +module.exports = { + mode: 'development', + entry: './app.ts', + output: { + filename: 'bundle.js' + }, + resolve: { + extensions: ['.ts', '.js'] + }, + module: { + rules: [ + { test: /\.ts$/, loader: 'ts-loader', options: { projectReferences: true } } + ] + } +} + +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } \ No newline at end of file From 392eefd03684d61f8a2a4c81965ed44c723943a4 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 18 Sep 2019 15:58:39 -0700 Subject: [PATCH 18/19] Additional guidance for no emit when referenced file build is failed --- src/index.ts | 22 +++++++++++-------- .../expectedOutput-3.6/bundle.js | 2 +- .../expectedOutput-3.6/output.txt | 5 +++-- .../expectedOutput-3.6/bundle.js | 2 +- .../expectedOutput-3.6/output.txt | 10 ++++----- .../expectedOutput-3.6/bundle.js | 2 +- .../expectedOutput-3.6/output.txt | 8 +++---- 7 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7e8125905..8f418ef8e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -134,7 +134,8 @@ function successLoader( loaderContext, options, fileVersion, - callback + callback, + instance ); } else { const { outputText, sourceMapText } = options.transpileOnly @@ -149,7 +150,8 @@ function successLoader( loaderContext, options, fileVersion, - callback + callback, + instance ); } } @@ -162,15 +164,17 @@ function makeSourceMapAndFinish( loaderContext: webpack.loader.LoaderContext, options: LoaderOptions, fileVersion: number, - callback: webpack.loader.loaderCallback + callback: webpack.loader.loaderCallback, + instance: TSInstance ) { if (outputText === null || outputText === undefined) { - const additionalGuidance = - !options.allowTsInNodeModules && filePath.indexOf('node_modules') !== -1 - ? ' By default, ts-loader will not compile .ts files in node_modules.\n' + - 'You should not need to recompile .ts files there, but if you really want to, use the allowTsInNodeModules option.\n' + - 'See: https://github.com/Microsoft/TypeScript/issues/12358' - : ''; + const additionalGuidance = isReferencedFile(instance, filePath) + ? ' The most common cause for this is having errors when building referenced projects.' + : !options.allowTsInNodeModules && filePath.indexOf('node_modules') !== -1 + ? ' By default, ts-loader will not compile .ts files in node_modules.\n' + + 'You should not need to recompile .ts files there, but if you really want to, use the allowTsInNodeModules option.\n' + + 'See: https://github.com/Microsoft/TypeScript/issues/12358' + : ''; throw new Error( `TypeScript emitted no output for ${filePath}.${additionalGuidance}` diff --git a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.js index d5bd6d537..012a29995 100644 --- a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.js +++ b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/bundle.js @@ -106,7 +106,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nexports.__esModule = true;\nexports.foo = 'foo';\n\n\n//# sourceURL=webpack:///./lib/foo.ts?"); +eval("\r\nexports.__esModule = true;\r\nexports.foo = 'foo';\r\n\n\n//# sourceURL=webpack:///./lib/foo.ts?"); /***/ }), diff --git a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt index b0f1d6a4f..767c04e59 100644 --- a/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNoSourceMap/expectedOutput-3.6/output.txt @@ -1,8 +1,9 @@ Asset Size Chunks Chunk Names - bundle.js 4.69 KiB main [emitted] main + bundle.js 4.7 KiB main [emitted] main + ../lib/foo.d.ts 35 bytes [emitted] ../lib/index.d.ts 107 bytes [emitted] ../lib/tsconfig.tsbuildinfo 68.8 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/foo.ts] 62 bytes {main} [built] +[./lib/foo.ts] 65 bytes {main} [built] [./lib/index.ts] 156 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js index fddc6f2ee..2a0dc3143 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/bundle.js @@ -105,7 +105,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /*! no static exports found */ /***/ (function(module, exports) { -eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesNotBuilt_SemanticErrorInReference//lib//index.ts./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:78:15)/n at successLoader (c://github//ts-loader//dist//index.js:68:9)/n at Object.loader (c://github//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesNotBuilt_SemanticErrorInReference//lib//index.ts. The most common cause for this is having errors when building referenced projects./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:80:15)/n at successLoader (c://github//ts-loader//dist//index.js:68:9)/n at Object.loader (c://github//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt index 2d1b9e78b..416dd5c2f 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt @@ -1,13 +1,13 @@ - Asset Size Chunks Chunk Names -bundle.js 4.61 KiB main [emitted] main + Asset Size Chunks Chunk Names +bundle.js 4.7 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/index.ts] 426 bytes {main} [built] [failed] [1 error] +[./lib/index.ts] 509 bytes {main} [built] [failed] [1 error] ERROR in ./lib/index.ts Module build failed (from /index.js): -Error: TypeScript emitted no output for lib\index.ts. - at makeSourceMapAndFinish (dist\index.js:78:15) +Error: TypeScript emitted no output for lib\index.ts. The most common cause for this is having errors when building referenced projects. + at makeSourceMapAndFinish (dist\index.js:80:15) at successLoader (dist\index.js:68:9) at Object.loader (dist\index.js:22:12) @ ./app.ts 3:12-28 diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js index 36903e850..9de08bd27 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/bundle.js @@ -105,7 +105,7 @@ eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ /*! no static exports found */ /***/ (function(module, exports) { -eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesNotBuilt_SyntaxErrorInReference//lib//index.ts./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:78:15)/n at successLoader (c://github//ts-loader//dist//index.js:68:9)/n at Object.loader (c://github//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); +eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesNotBuilt_SyntaxErrorInReference//lib//index.ts. The most common cause for this is having errors when building referenced projects./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:80:15)/n at successLoader (c://github//ts-loader//dist//index.js:68:9)/n at Object.loader (c://github//ts-loader//dist//index.js:22:12)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); /***/ }) diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt index 6acd185d7..fc62d1772 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt @@ -1,13 +1,13 @@ Asset Size Chunks Chunk Names -bundle.js 4.61 KiB main [emitted] main +bundle.js 4.69 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/index.ts] 424 bytes {main} [built] [failed] [1 error] +[./lib/index.ts] 507 bytes {main} [built] [failed] [1 error] ERROR in ./lib/index.ts Module build failed (from /index.js): -Error: TypeScript emitted no output for lib\index.ts. - at makeSourceMapAndFinish (dist\index.js:78:15) +Error: TypeScript emitted no output for lib\index.ts. The most common cause for this is having errors when building referenced projects. + at makeSourceMapAndFinish (dist\index.js:80:15) at successLoader (dist\index.js:68:9) at Object.loader (dist\index.js:22:12) @ ./app.ts 3:12-28 From 42cb006873ed45a2139b6795b1131c9365127a18 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 18 Sep 2019 16:50:43 -0700 Subject: [PATCH 19/19] Solution errors per module --- src/after-compile.ts | 76 +++++++++++++++++-- src/interfaces.ts | 8 +- src/servicesHost.ts | 59 ++++++++++---- .../expectedOutput-3.6/output.txt | 6 +- .../expectedOutput-3.6/output.txt | 6 +- .../expectedOutput-3.6/patch2/output.txt | 10 ++- 6 files changed, 137 insertions(+), 28 deletions(-) diff --git a/src/after-compile.ts b/src/after-compile.ts index 10ab77852..b4db4d139 100644 --- a/src/after-compile.ts +++ b/src/after-compile.ts @@ -11,7 +11,6 @@ import { WebpackError, WebpackModule } from './interfaces'; -import { getSolutionErrors } from './servicesHost'; import { collectAllDependants, ensureProgram, @@ -69,12 +68,9 @@ export function makeAfterCompile( compilation ); + provideSolutionErrorsToWebpack(compilation, modules, instance); provideTsBuildInfoFilesToWebpack(instance, compilation); - // append errors - compilation.errors.push( - ...getSolutionErrors(instance, compilation.compiler.context) - ); instance.filesWithErrors = filesWithErrors; instance.modifiedFiles = null; instance.projectsMissingSourceMaps = new Set(); @@ -262,6 +258,76 @@ function provideErrorsToWebpack( } } +function provideSolutionErrorsToWebpack( + compilation: webpack.compilation.Compilation, + modules: Map, + instance: TSInstance +) { + if ( + !instance.solutionBuilderHost || + !( + instance.solutionBuilderHost.diagnostics.global.length || + instance.solutionBuilderHost.diagnostics.perFile.size + ) + ) { + return; + } + + const { + compiler, + loaderOptions, + solutionBuilderHost: { diagnostics } + } = instance; + + for (const [filePath, perFileDiagnostics] of diagnostics.perFile) { + // if we have access to a webpack module, use that + const associatedModules = modules.get(filePath); + if (associatedModules !== undefined) { + associatedModules.forEach(module => { + // remove any existing errors + removeTSLoaderErrors(module.errors); + + // append errors + const formattedErrors = formatErrors( + perFileDiagnostics, + loaderOptions, + instance.colors, + compiler, + { module }, + compilation.compiler.context + ); + + module.errors.push(...formattedErrors); + compilation.errors.push(...formattedErrors); + }); + } else { + // otherwise it's a more generic error + const formattedErrors = formatErrors( + perFileDiagnostics, + loaderOptions, + instance.colors, + compiler, + { file: filePath }, + compilation.compiler.context + ); + + compilation.errors.push(...formattedErrors); + } + } + + // Add global solution errors + compilation.errors.push( + ...formatErrors( + diagnostics.global, + instance.loaderOptions, + instance.colors, + instance.compiler, + { file: 'tsconfig.json' }, + compilation.compiler.context + ) + ); +} + /** * gather all declaration files from TypeScript and output them to webpack */ diff --git a/src/interfaces.ts b/src/interfaces.ts index dcfd64ddc..debb858a5 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -75,12 +75,18 @@ export interface WatchFactory { ): typescript.FileWatcher; } +export interface SolutionDiagnostics { + global: typescript.Diagnostic[]; + perFile: Map; + transpileErrors: [string | undefined, typescript.Diagnostic[]][]; +} + export interface SolutionBuilderWithWatchHost extends typescript.SolutionBuilderWithWatchHost< typescript.EmitAndSemanticDiagnosticsBuilderProgram >, WatchFactory { - diagnostics: typescript.Diagnostic[]; + diagnostics: SolutionDiagnostics; } export interface TSInstance { diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 36f6122a4..971c4ec9a 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -12,6 +12,7 @@ import { ResolvedModule, ResolveSync, SolutionBuilderWithWatchHost, + SolutionDiagnostics, TSInstance, WatchCallbacks, WatchFactory, @@ -583,7 +584,8 @@ export function makeSolutionBuilderHost( appendTsTsxSuffixesIfRequired, loaderOptions: { resolveModuleName: customResolveModuleName, - resolveTypeReferenceDirective: customResolveTypeReferenceDirective + resolveTypeReferenceDirective: customResolveTypeReferenceDirective, + transpileOnly } } = instance; @@ -597,8 +599,32 @@ export function makeSolutionBuilderHost( getNewLine: () => compiler.sys.newLine }; + const diagnostics: SolutionDiagnostics = { + global: [], + perFile: new Map(), + transpileErrors: [] + }; const reportDiagnostic = (d: typescript.Diagnostic) => { - solutionBuilderHost.diagnostics.push(d); + if (transpileOnly) { + const filePath = d.file ? path.resolve(d.file.fileName) : undefined; + const last = + diagnostics.transpileErrors[diagnostics.transpileErrors.length - 1]; + if (diagnostics.transpileErrors.length && last[0] === filePath) { + last[1].push(d); + } else { + diagnostics.transpileErrors.push([filePath, [d]]); + } + } else if (d.file) { + const filePath = path.resolve(d.file.fileName); + const existing = diagnostics.perFile.get(filePath); + if (existing) { + existing.push(d); + } else { + diagnostics.perFile.set(filePath, [d]); + } + } else { + diagnostics.global.push(d); + } log.logInfo(compiler.formatDiagnostic(d, formatDiagnosticHost)); }; @@ -623,7 +649,7 @@ export function makeSolutionBuilderHost( reportSolutionBuilderStatus, reportWatchStatus ), - diagnostics: [], + diagnostics, ...createWatchFactory(beforeWatchCallbacks), // Overrides getCurrentDirectory, @@ -659,7 +685,9 @@ export function makeSolutionBuilderHost( return solutionBuilderHost; function beforeWatchCallbacks() { - solutionBuilderHost.diagnostics.length = 0; + diagnostics.global.length = 0; + diagnostics.perFile.clear(); + diagnostics.transpileErrors.length = 0; } } @@ -667,19 +695,20 @@ export function getSolutionErrors(instance: TSInstance, context: string) { const solutionErrors: WebpackError[] = []; if ( instance.solutionBuilderHost && - instance.solutionBuilderHost.diagnostics.length + instance.solutionBuilderHost.diagnostics.transpileErrors.length ) { - instance.solutionBuilderHost.diagnostics.forEach(d => - solutionErrors.push( - ...formatErrors( - [d], - instance.loaderOptions, - instance.colors, - instance.compiler, - { file: d.file ? undefined : 'tsconfig.json' }, - context + instance.solutionBuilderHost.diagnostics.transpileErrors.forEach( + ([filePath, errors]) => + solutionErrors.push( + ...formatErrors( + errors, + instance.loaderOptions, + instance.colors, + instance.compiler, + { file: filePath ? undefined : 'tsconfig.json' }, + context + ) ) - ) ); } return solutionErrors; diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt index 416dd5c2f..a98b3d39a 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.6/output.txt @@ -2,7 +2,7 @@ bundle.js 4.7 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/index.ts] 509 bytes {main} [built] [failed] [1 error] +[./lib/index.ts] 509 bytes {main} [built] [failed] [2 errors] ERROR in ./lib/index.ts Module build failed (from /index.js): @@ -16,5 +16,7 @@ ERROR in tsconfig.json [tsl] ERROR  TS6305: Output file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SemanticErrorInReference/lib/index.ts'. -ERROR in [tsl] ERROR in lib\index.ts(6,7) +ERROR in lib\index.ts +./lib/index.ts +[tsl] ERROR in lib\index.ts(6,7)  TS2322: Type '10' is not assignable to type 'string'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt index fc62d1772..8304bdb95 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.6/output.txt @@ -2,7 +2,7 @@ bundle.js 4.69 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/index.ts] 507 bytes {main} [built] [failed] [1 error] +[./lib/index.ts] 507 bytes {main} [built] [failed] [2 errors] ERROR in ./lib/index.ts Module build failed (from /index.js): @@ -16,5 +16,7 @@ ERROR in tsconfig.json [tsl] ERROR  TS6305: Output file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference/lib/index.ts'. -ERROR in [tsl] ERROR in lib\index.ts(4,12) +ERROR in lib\index.ts +./lib/index.ts +[tsl] ERROR in lib\index.ts(4,12)  TS1136: Property assignment expected. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt index 47604851e..0bb04ab4b 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-3.6/patch2/output.txt @@ -4,10 +4,14 @@ ../lib/tsconfig.tsbuildinfo 68.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 169 bytes {main} [built] -[./lib/index.ts] 136 bytes {main} [built] +[./lib/index.ts] 136 bytes {main} [built] [2 errors] -ERROR in [tsl] ERROR in lib\index.ts(6,3) +ERROR in lib\index.ts +./lib/index.ts +[tsl] ERROR in lib\index.ts(6,3)  TS1136: Property assignment expected. -ERROR in [tsl] ERROR in lib\index.ts(7,1) +ERROR in lib\index.ts +./lib/index.ts +[tsl] ERROR in lib\index.ts(7,1)  TS1128: Declaration or statement expected. \ No newline at end of file