diff --git a/src/after-compile.ts b/src/after-compile.ts index d6547848d..8fa9da180 100644 --- a/src/after-compile.ts +++ b/src/after-compile.ts @@ -3,7 +3,11 @@ import * as ts from 'typescript'; import * as webpack from 'webpack'; import * as constants from './constants'; -import { getEmitFromWatchHost, getEmitOutput } from './instances'; +import { + getEmitFromWatchHost, + getEmitOutput, + isReferencedFile +} from './instances'; import { TSFile, TSFiles, @@ -339,25 +343,24 @@ function provideDeclarationFilesToWebpack( continue; } - addDeclarationFilesAsAsset( - getEmitOutput( - instance, - filePath, - /*skipActualOutputReadOfReferencedFile*/ true - ), - compilation - ); + if (!isReferencedFile(instance, filePath)) { + addDeclarationFilesAsAsset( + getEmitOutput(instance, filePath), + compilation + ); + } } } -function addDeclarationFilesAsAsset( - outputFiles: ts.OutputFile[] | IterableIterator, - compilation: webpack.compilation.Compilation +function addDeclarationFilesAsAsset( + outputFiles: T[] | IterableIterator, + compilation: webpack.compilation.Compilation, + skipOutputFile?: (outputFile: T) => boolean ) { - outputFilesToAsset( - outputFiles, - compilation, - outputFile => !outputFile.name.match(constants.dtsDtsxOrDtsDtsxMapRegex) + outputFilesToAsset(outputFiles, compilation, outputFile => + skipOutputFile && skipOutputFile(outputFile) + ? true + : !outputFile.name.match(constants.dtsDtsxOrDtsDtsxMapRegex) ); } @@ -375,10 +378,10 @@ function outputFileToAsset( }; } -function outputFilesToAsset( - outputFiles: ts.OutputFile[] | IterableIterator, +function outputFilesToAsset( + outputFiles: T[] | IterableIterator, compilation: webpack.compilation.Compilation, - skipOutputFile?: (outputFile: ts.OutputFile) => boolean + skipOutputFile?: (outputFile: T) => boolean ) { for (const outputFile of outputFiles) { if (!skipOutputFile || !skipOutputFile(outputFile)) { @@ -417,12 +420,21 @@ function provideAssetsFromSolutionBuilderHost( // written files addDeclarationFilesAsAsset( instance.solutionBuilderHost.outputFiles.values(), - compilation + compilation, + outputFile => !outputFile.isNew ); // tsbuild infos - outputFilesToAsset(instance.solutionBuilderHost.tsbuildinfos, compilation); - instance.solutionBuilderHost.outputFiles.clear(); - instance.solutionBuilderHost.tsbuildinfos.length = 0; + outputFilesToAsset( + instance.solutionBuilderHost.tsbuildinfos.values(), + compilation, + outputFile => !outputFile.isNew + ); + instance.solutionBuilderHost.outputFiles.forEach( + outputFile => (outputFile.isNew = false) + ); + instance.solutionBuilderHost.tsbuildinfos.forEach( + outputFile => (outputFile.isNew = false) + ); } } diff --git a/src/index.ts b/src/index.ts index 34ed8c978..be22b18a0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,9 +5,11 @@ import * as webpack from 'webpack'; import * as constants from './constants'; import { + buildSolutionReferences, getEmitOutput, getInputFileNameFromOutput, getTypeScriptInstance, + initializeInstance, isReferencedFile } from './instances'; import { @@ -44,36 +46,38 @@ function loader(this: webpack.loader.LoaderContext, contents: string) { return; } - return successLoader( - this, - contents, - callback, - options, - instanceOrError.instance! - ); + const instance = instanceOrError.instance!; + buildSolutionReferences(instance, this, instance.log); + successLoader(this, contents, callback, instance); } function successLoader( loaderContext: webpack.loader.LoaderContext, contents: string, callback: webpack.loader.loaderCallback, - options: LoaderOptions, instance: TSInstance ) { + initializeInstance(loaderContext, instance); const rawFilePath = path.normalize(loaderContext.resourcePath); const filePath = - options.appendTsSuffixTo.length > 0 || options.appendTsxSuffixTo.length > 0 + instance.loaderOptions.appendTsSuffixTo.length > 0 || + instance.loaderOptions.appendTsxSuffixTo.length > 0 ? appendSuffixesIfMatch( { - '.ts': options.appendTsSuffixTo, - '.tsx': options.appendTsxSuffixTo + '.ts': instance.loaderOptions.appendTsSuffixTo, + '.tsx': instance.loaderOptions.appendTsxSuffixTo }, rawFilePath ) : rawFilePath; - const fileVersion = updateFileInCache(options, filePath, contents, instance); + const fileVersion = updateFileInCache( + instance.loaderOptions, + filePath, + contents, + instance + ); const referencedProject = getAndCacheProjectReference(filePath, instance); if (referencedProject !== undefined) { const [relativeProjectConfigPath, relativeFilePath] = [ @@ -133,13 +137,12 @@ function successLoader( filePath, contents, loaderContext, - options, fileVersion, callback, instance ); } else { - const { outputText, sourceMapText } = options.transpileOnly + const { outputText, sourceMapText } = instance.loaderOptions.transpileOnly ? getTranspilationEmit(filePath, contents, instance, loaderContext) : getEmit(rawFilePath, filePath, instance, loaderContext); @@ -149,7 +152,6 @@ function successLoader( filePath, contents, loaderContext, - options, fileVersion, callback, instance @@ -163,23 +165,29 @@ function makeSourceMapAndFinish( filePath: string, contents: string, loaderContext: webpack.loader.LoaderContext, - options: LoaderOptions, fileVersion: number, callback: webpack.loader.loaderCallback, instance: TSInstance ) { if (outputText === null || outputText === undefined) { + setModuleMeta(loaderContext, instance, fileVersion); 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 + : !instance.loaderOptions.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}` + callback( + new Error( + `TypeScript emitted no output for ${filePath}.${additionalGuidance}` + ), + outputText, + undefined ); + return; } const { sourceMap, output } = makeSourceMap( @@ -190,15 +198,25 @@ function makeSourceMapAndFinish( loaderContext ); + setModuleMeta(loaderContext, instance, fileVersion); + callback(null, output, sourceMap); +} + +function setModuleMeta( + loaderContext: webpack.loader.LoaderContext, + instance: TSInstance, + fileVersion: number +) { // _module.meta is not available inside happypack - if (!options.happyPackMode && loaderContext._module.buildMeta !== undefined) { + if ( + !instance.loaderOptions.happyPackMode && + loaderContext._module.buildMeta !== undefined + ) { // Make sure webpack is aware that even though the emitted JavaScript may be the same as // a previously cached version the TypeScript may be different and therefore should be // treated as new loaderContext._module.buildMeta.tsLoaderFileVersion = fileVersion; } - - callback(null, output, sourceMap); } /** @@ -395,14 +413,15 @@ function updateFileInCache( // it is allowed by the options. (options.allowTsInNodeModules || filePath.indexOf('node_modules') === -1) ) { - instance.version!++; + instance.version++; instance.rootFileNames.add(filePath); } if (file.text !== contents) { file.version++; file.text = contents; - instance.version!++; + file.modifiedTime = new Date(); + instance.version++; if ( (instance.watchHost !== undefined || instance.solutionBuilderHost !== undefined) && @@ -447,73 +466,70 @@ function getEmit( instance: TSInstance, loaderContext: webpack.loader.LoaderContext ) { - const outputFiles = getEmitOutput( - instance, - filePath, - /*skipActualOutputReadOfReferencedFile*/ false - ); - - if (!isReferencedFile(instance, filePath)) { - loaderContext.clearDependencies(); - loaderContext.addDependency(rawFilePath); + const outputFiles = getEmitOutput(instance, filePath); + loaderContext.clearDependencies(); + loaderContext.addDependency(rawFilePath); - const allDefinitionFiles = [...instance.files.keys()].filter( - defFilePath => - defFilePath.match(constants.dtsDtsxOrDtsDtsxMapRegex) && - // Remove the project reference d.ts as we are adding dependency for .ts later - // This removed extra build pass (resulting in new stats object in initial build) - (!instance.solutionBuilderHost || - !getInputFileNameFromOutput(instance, defFilePath)) - ); + const allDefinitionFiles = isReferencedFile(instance, filePath) + ? [] + : [...instance.files.keys()].filter( + defFilePath => + defFilePath.match(constants.dtsDtsxOrDtsDtsxMapRegex) && + // Remove the project reference d.ts as we are adding dependency for .ts later + // This removed extra build pass (resulting in new stats object in initial build) + (!instance.solutionBuilderHost || + instance.solutionBuilderHost.getOutputFileFromReferencedProject( + defFilePath + ) !== undefined) + ); - // 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(({ resolvedFileName, originalFileName }) => { - const projectReference = getAndCacheProjectReference( + // 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(({ 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. + if (projectReference !== undefined) { + return getAndCacheOutputJSFileName( resolvedFileName, + projectReference, 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. - if (projectReference !== undefined) { - return getAndCacheOutputJSFileName( - resolvedFileName, - projectReference, - instance - ); - } - return ( - getInputFileNameFromOutput( - instance, - path.resolve(resolvedFileName) - ) || originalFileName - ); - }); - - if (additionalDependencies.length > 0) { - additionalDependencies.forEach(addDependency); - } - - loaderContext._module.buildMeta.tsLoaderDefinitionFileVersions = allDefinitionFiles - .concat(additionalDependencies) - .map( - defFilePath => - defFilePath + - '@' + - ( - instance.files.get(defFilePath) || - instance.otherFiles.get(defFilePath) || { version: '?' } - ).version - ); + } + return ( + getInputFileNameFromOutput( + instance, + path.resolve(resolvedFileName) + ) || originalFileName + ); + }); + + if (additionalDependencies.length > 0) { + additionalDependencies.forEach(addDependency); } + loaderContext._module.buildMeta.tsLoaderDefinitionFileVersions = allDefinitionFiles + .concat(additionalDependencies) + .map( + defFilePath => + defFilePath + + '@' + + ( + instance.files.get(defFilePath) || + instance.otherFiles.get(defFilePath) || { version: '?' } + ).version + ); + const outputFile = outputFiles .filter(file => file.name.match(constants.jsJsx)) .pop(); diff --git a/src/instances.ts b/src/instances.ts index 2e3ae9dbe..794ee37d3 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -48,7 +48,9 @@ export function getTypeScriptInstance( ): { instance?: TSInstance; error?: WebpackError } { if (instances.hasOwnProperty(loaderOptions.instance)) { const instance = instances[loaderOptions.instance]; - ensureProgram(instance); + if (!instance.initialSetupPending) { + ensureProgram(instance); + } return { instance: instances[loaderOptions.instance] }; } @@ -148,39 +150,6 @@ function successfulTypeScriptInstance( ) : (filePath: string) => filePath; - // same strategy as https://github.com/s-panferov/awesome-typescript-loader/pull/531/files - let { getCustomTransformers: customerTransformers } = loaderOptions; - let getCustomTransformers = Function.prototype; - - if (typeof customerTransformers === 'function') { - getCustomTransformers = customerTransformers; - } else if (typeof customerTransformers === 'string') { - try { - customerTransformers = require(customerTransformers); - } catch (err) { - throw new Error( - `Failed to load customTransformers from "${ - loaderOptions.getCustomTransformers - }": ${err.message}` - ); - } - - if (typeof customerTransformers !== 'function') { - throw new Error( - `Custom transformers in "${ - loaderOptions.getCustomTransformers - }" should export a function, got ${typeof getCustomTransformers}` - ); - } - 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 @@ -192,47 +161,18 @@ function successfulTypeScriptInstance( rootFileNames, files, otherFiles, + version: 0, 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 + colors, + initialSetupPending: true, + configFilePath, + configParseResult, + log }); - 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)); - - // 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, - loaderOptions, - colors, - compiler!, - { file: configFilePath || 'tsconfig.json' }, - loader.context - ); - loader._module.errors.push(...solutionErrors, ...errors); - } - transpileInstance.transformers = getCustomTransformers(program); return { instance: transpileInstance }; } @@ -276,88 +216,166 @@ function successfulTypeScriptInstance( transformers: {} as typescript.CustomTransformers, // this is only set temporarily, custom transformers are created further down dependencyGraph: {}, reverseDependencyGraph: {}, - colors + colors, + initialSetupPending: true, + configFilePath, + configParseResult, + log }); - if (!loader._compiler.hooks) { - throw new Error( - "You may be using an old version of webpack; please check you're using at least version 4" - ); + return { instance }; +} + +export function initializeInstance( + loader: webpack.loader.LoaderContext, + instance: TSInstance +) { + if (!instance.initialSetupPending) { + return; } - tryAndBuildSolutionReferences( - instance, - loader, - log, - scriptRegex, - configFilePath - ); + instance.initialSetupPending = false; - if (loaderOptions.experimentalWatchApi && compiler.createWatchProgram) { - log.logInfo('Using watch api'); + // same strategy as https://github.com/s-panferov/awesome-typescript-loader/pull/531/files + let { getCustomTransformers: customerTransformers } = instance.loaderOptions; + let getCustomTransformers = Function.prototype; - // If there is api available for watch, use it instead of language service - instance.watchHost = makeWatchHost( - scriptRegex, - log, - loader, - instance, - configParseResult.projectReferences - ); - instance.watchOfFilesAndCompilerOptions = compiler.createWatchProgram( - instance.watchHost - ); - instance.builderProgram = instance.watchOfFilesAndCompilerOptions.getProgram(); - instance.program = instance.builderProgram.getProgram(); + if (typeof customerTransformers === 'function') { + getCustomTransformers = customerTransformers; + } else if (typeof customerTransformers === 'string') { + try { + customerTransformers = require(customerTransformers); + } catch (err) { + throw new Error( + `Failed to load customTransformers from "${ + instance.loaderOptions.getCustomTransformers + }": ${err.message}` + ); + } - instance.transformers = getCustomTransformers(instance.program); + if (typeof customerTransformers !== 'function') { + throw new Error( + `Custom transformers in "${ + instance.loaderOptions.getCustomTransformers + }" should export a function, got ${typeof getCustomTransformers}` + ); + } + getCustomTransformers = customerTransformers; + } + + if (instance.loaderOptions.transpileOnly) { + const program = (instance.program = + instance.configParseResult.projectReferences !== undefined + ? instance.compiler.createProgram({ + rootNames: instance.configParseResult.fileNames, + options: instance.configParseResult.options, + projectReferences: instance.configParseResult.projectReferences + }) + : instance.compiler.createProgram([], instance.compilerOptions)); + + // happypack does not have _module.errors - see https://github.com/TypeStrong/ts-loader/issues/336 + if (!instance.loaderOptions.happyPackMode) { + const solutionErrors: WebpackError[] = getSolutionErrors( + instance, + loader.context + ); + const diagnostics = program.getOptionsDiagnostics(); + const errors = formatErrors( + diagnostics, + instance.loaderOptions, + instance.colors, + instance.compiler, + { file: instance.configFilePath || 'tsconfig.json' }, + loader.context + ); + loader._module.errors.push(...solutionErrors, ...errors); + } + instance.transformers = getCustomTransformers(program); } else { - const servicesHost = makeServicesHost( - scriptRegex, - log, - loader, - instance, - loaderOptions.experimentalFileCaching, - configParseResult.projectReferences - ); + if (!loader._compiler.hooks) { + throw new Error( + "You may be using an old version of webpack; please check you're using at least version 4" + ); + } - instance.languageService = compiler.createLanguageService( - servicesHost.servicesHost, - compiler.createDocumentRegistry() - ); + if ( + instance.loaderOptions.experimentalWatchApi && + instance.compiler.createWatchProgram + ) { + instance.log.logInfo('Using watch api'); - if (servicesHost.clearCache !== null) { - loader._compiler.hooks.watchRun.tap('ts-loader', servicesHost.clearCache); + // If there is api available for watch, use it instead of language service + instance.watchHost = makeWatchHost( + getScriptRegexp(instance), + instance.log, + loader, + instance, + instance.configParseResult.projectReferences + ); + instance.watchOfFilesAndCompilerOptions = instance.compiler.createWatchProgram( + instance.watchHost + ); + instance.builderProgram = instance.watchOfFilesAndCompilerOptions.getProgram(); + instance.program = instance.builderProgram.getProgram(); + + instance.transformers = getCustomTransformers(instance.program); + } else { + instance.servicesHost = makeServicesHost( + getScriptRegexp(instance), + instance.log, + loader, + instance, + instance.loaderOptions.experimentalFileCaching, + instance.configParseResult.projectReferences + ); + + instance.languageService = instance.compiler.createLanguageService( + instance.servicesHost.servicesHost, + instance.compiler.createDocumentRegistry() + ); + + if (instance.servicesHost.clearCache !== null) { + loader._compiler.hooks.watchRun.tap( + 'ts-loader', + instance.servicesHost.clearCache + ); + } + + instance.transformers = getCustomTransformers( + instance.languageService!.getProgram() + ); } - instance.transformers = getCustomTransformers( - instance.languageService!.getProgram() + loader._compiler.hooks.afterCompile.tapAsync( + 'ts-loader', + makeAfterCompile(instance, instance.configFilePath) + ); + loader._compiler.hooks.watchRun.tapAsync( + 'ts-loader', + makeWatchRun(instance) ); } +} - loader._compiler.hooks.afterCompile.tapAsync( - 'ts-loader', - makeAfterCompile(instance, configFilePath) - ); - loader._compiler.hooks.watchRun.tapAsync('ts-loader', makeWatchRun(instance)); - - return { instance }; +function getScriptRegexp(instance: TSInstance) { + // if allowJs is set then we should accept js(x) files + return instance.configParseResult.options.allowJs === true + ? /\.tsx?$|\.jsx?$/i + : /\.tsx?$/i; } -function tryAndBuildSolutionReferences( +export function buildSolutionReferences( instance: TSInstance, loader: webpack.loader.LoaderContext, - log: logger.Logger, - scriptRegex: RegExp, - configFilePath: string | undefined + log: logger.Logger ) { - if ( - configFilePath && - supportsSolutionBuild(instance.loaderOptions, instance.compiler) - ) { + if (!supportsSolutionBuild(instance)) { + return; + } + if (!instance.solutionBuilderHost) { // Use solution builder log.logInfo('Using SolutionBuilder api'); - instance.configFilePath = configFilePath; + const scriptRegex = getScriptRegexp(instance); instance.solutionBuilderHost = makeSolutionBuilderHost( scriptRegex, log, @@ -366,20 +384,11 @@ function tryAndBuildSolutionReferences( ); instance.solutionBuilder = instance.compiler.createSolutionBuilderWithWatch( instance.solutionBuilderHost, - [configFilePath], + [instance.configFilePath!], { verbose: true } ); - instance.solutionBuilder.buildReferences(instance.configFilePath); - for (const [fileName] of instance.solutionBuilderHost.watchedFiles) { - instance.otherFiles.set(path.resolve(fileName), { - version: 0, - text: instance.solutionBuilderHost.readFile(fileName) - }); - if (instance.loaderOptions.transpileOnly) { - loader.addDependency(fileName); - } - } } + instance.solutionBuilder!.buildReferences(instance.configFilePath!); } export function forEachResolvedProjectReference( @@ -493,7 +502,7 @@ function getOutputJSFileName( : undefined; } -function getOutputFileNames( +export function getOutputFileNames( instance: TSInstance, configFile: typescript.ParsedCommandLine, inputFileName: string @@ -539,49 +548,6 @@ function getOutputFileNames( return outputs; } -function getOutputFilesFromReference( - program: typescript.Program, - instance: TSInstance, - filePath: string, - skipActualOutputRead: boolean -): typescript.OutputFile[] | undefined { - // May be api to get file - return forEachResolvedProjectReference( - program.getResolvedProjectReferences(), - ({ commandLine }) => { - const { options, fileNames } = commandLine; - if ( - !options.outFile && - !options.out && - fileNames.some(file => path.normalize(file) === filePath) - ) { - const outputFiles: typescript.OutputFile[] = []; - if (!skipActualOutputRead) { - getOutputFileNames( - instance, - commandLine, - (instance.compiler as any).resolvePath(filePath) - ).forEach(name => { - const output = instance.solutionBuilderHost!.outputFiles.get( - path.resolve(name) - ); - if (output) { - outputFiles.push(output); - } else { - const text = instance.compiler.sys.readFile(name); - if (text) { - outputFiles.push({ name, text, writeByteOrderMark: false }); - } - } - }); - } - return outputFiles; - } - return undefined; - } - ); -} - export function getInputFileNameFromOutput( instance: TSInstance, filePath: string @@ -589,6 +555,9 @@ export function getInputFileNameFromOutput( if (filePath.match(tsTsxRegex) && !fileExtensionIs(filePath, '.d.ts')) { return undefined; } + if (instance.solutionBuilderHost) { + return instance.solutionBuilderHost.getInputFileNameFromOutput(filePath); + } const program = ensureProgram(instance); return ( program && @@ -671,11 +640,7 @@ export function getEmitFromWatchHost(instance: TSInstance, filePath?: string) { return undefined; } -export function getEmitOutput( - instance: TSInstance, - filePath: string, - skipActualOutputReadOfReferencedFile: boolean -) { +export function getEmitOutput(instance: TSInstance, filePath: string) { if (fileExtensionIs(filePath, instance.compiler.Extension.Dts)) { return []; } @@ -683,15 +648,9 @@ export function getEmitOutput( if (program !== undefined) { const sourceFile = program.getSourceFile(filePath); if (isReferencedFile(instance, filePath)) { - const builtReferences = getOutputFilesFromReference( - program, - instance, - filePath, - skipActualOutputReadOfReferencedFile + return instance.solutionBuilderHost!.getOutputFilesFromReferencedProjectInput( + filePath ); - if (builtReferences) { - return builtReferences; - } } const outputFiles: typescript.OutputFile[] = []; const writeFile = ( diff --git a/src/interfaces.ts b/src/interfaces.ts index 0760c471a..31be0111f 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -2,6 +2,7 @@ export { ModuleResolutionHost, FormatDiagnosticsHost } from 'typescript'; import * as typescript from 'typescript'; import { Chalk } from 'chalk'; +import * as logger from './logger'; export interface ErrorInfo { code: number; @@ -37,6 +38,13 @@ export type ResolveSync = ( moduleName: string ) => string; +export type Action = () => void; + +export interface ServiceHostWhichMayBeCacheable { + servicesHost: typescript.LanguageServiceHost; + clearCache: Action | null; +} + export interface WatchHost extends typescript.WatchCompilerHostOfFilesAndCompilerOptions< typescript.EmitAndSemanticDiagnosticsBuilderProgram @@ -64,19 +72,9 @@ export interface WatchFactory { ): 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, - options?: typescript.CompilerOptions - ): typescript.FileWatcher; + watchFile: typescript.WatchHost['watchFile']; /** 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, - options?: typescript.CompilerOptions - ): typescript.FileWatcher; + watchDirectory: typescript.WatchHost['watchDirectory']; } export interface SolutionDiagnostics { @@ -91,8 +89,20 @@ export interface SolutionBuilderWithWatchHost >, WatchFactory { diagnostics: SolutionDiagnostics; - outputFiles: Map; - tsbuildinfos: typescript.OutputFile[]; + outputFiles: Map; + tsbuildinfos: Map; + outputAffectingInstanceVersion: Map; + getOutputFileFromReferencedProject( + outputFileName: string + ): OutputFile | false | undefined; + getInputFileNameFromOutput(outputFileName: string): string | undefined; + getOutputFilesFromReferencedProjectInput(inputFileName: string): OutputFile[]; +} + +export interface OutputFile extends typescript.OutputFile { + time: Date; + version: number; + isNew: boolean; } export interface TSInstance { @@ -116,8 +126,9 @@ export interface TSInstance { * warnings about source maps during a single compilation. */ projectsMissingSourceMaps?: Set; + servicesHost?: ServiceHostWhichMayBeCacheable; languageService?: typescript.LanguageService | null; - version?: number; + version: number; dependencyGraph: DependencyGraph; reverseDependencyGraph: ReverseDependencyGraph; filesWithErrors?: TSFiles; @@ -138,7 +149,15 @@ export interface TSInstance { solutionBuilder?: typescript.SolutionBuilder< typescript.EmitAndSemanticDiagnosticsBuilderProgram >; - configFilePath?: string; + configFilePath: string | undefined; + + initialSetupPending: boolean; + configParseResult: { + options: typescript.CompilerOptions; + fileNames: string[]; + projectReferences?: ReadonlyArray; + }; + log: logger.Logger; } export interface LoaderOptionsCache { @@ -220,6 +239,7 @@ export interface LoaderOptions { export interface TSFile { text?: string; version: number; + modifiedTime?: Date; projectReference?: { /** * Undefined here means we’ve already checked and confirmed there is no diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 6be1f18a2..de245e7e6 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -4,13 +4,17 @@ import * as webpack from 'webpack'; import { getParsedCommandLine } from './config'; import * as constants from './constants'; +import { getOutputFileNames } from './instances'; import { + Action, CustomResolveModuleName, CustomResolveTypeReferenceDirective, FormatDiagnosticsHost, ModuleResolutionHost, + OutputFile, ResolvedModule, ResolveSync, + ServiceHostWhichMayBeCacheable, SolutionBuilderWithWatchHost, SolutionDiagnostics, TSFile, @@ -24,11 +28,23 @@ import * as logger from './logger'; import { makeResolver } from './resolver'; import { formatErrors, readFile, unorderedRemoveItem } from './utils'; -export type Action = () => void; - -export interface ServiceHostWhichMayBeCacheable { - servicesHost: typescript.LanguageServiceHost; - clearCache: Action | null; +function readFileWithInstance( + instance: TSInstance, + filePath: string, + encoding?: string | undefined +): string | undefined { + if (instance.solutionBuilderHost) { + const outputFile = instance.solutionBuilderHost.getOutputFileFromReferencedProject( + filePath + ); + if (outputFile !== undefined) { + return outputFile ? outputFile.text : undefined; + } + } + return ( + instance.compiler.sys.readFile(filePath, encoding) || + readFile(filePath, encoding) + ); } /** @@ -66,12 +82,22 @@ export function makeServicesHost( const readFileWithFallback = ( filePath: string, encoding?: string | undefined - ): string | undefined => - compiler.sys.readFile(filePath, encoding) || readFile(filePath, encoding); + ): string | undefined => readFileWithInstance(instance, filePath, encoding); - const fileExists = (filePathToCheck: string) => - compiler.sys.fileExists(filePathToCheck) || - readFile(filePathToCheck) !== undefined; + const fileExists = (filePathToCheck: string) => { + if (instance.solutionBuilderHost) { + const outputFile = instance.solutionBuilderHost.getOutputFileFromReferencedProject( + filePathToCheck + ); + if (outputFile !== undefined) { + return !!outputFile; + } + } + return ( + compiler.sys.fileExists(filePathToCheck) || + readFile(filePathToCheck) !== undefined + ); + }; let clearCache: Action | null = null; let moduleResolutionHost: ModuleResolutionHost = { @@ -115,7 +141,21 @@ export function makeServicesHost( getScriptVersion: (fileName: string) => { fileName = path.normalize(fileName); const file = files.get(fileName); - return file === undefined ? '' : file.version.toString(); + if (file) { + return file.version.toString(); + } + const outputFile = + instance.solutionBuilderHost && + instance.solutionBuilderHost.getOutputFileFromReferencedProject( + fileName + ); + if (outputFile !== undefined) { + instance.solutionBuilderHost!.outputAffectingInstanceVersion.set( + path.resolve(fileName), + true + ); + } + return outputFile ? outputFile.version.toString() : ''; }, getScriptSnapshot: (fileName: string) => { @@ -125,6 +165,21 @@ export function makeServicesHost( let file = files.get(fileName); if (file === undefined) { + if (instance.solutionBuilderHost) { + const outputFile = instance.solutionBuilderHost.getOutputFileFromReferencedProject( + fileName + ); + if (outputFile !== undefined) { + instance.solutionBuilderHost!.outputAffectingInstanceVersion.set( + path.resolve(fileName), + true + ); + return outputFile + ? compiler.ScriptSnapshot.fromString(outputFile.text) + : undefined; + } + } + const text = readFile(fileName); if (text === undefined) { return undefined; @@ -385,7 +440,8 @@ export function updateFileWithText( if (newText !== file.text) { file.text = newText; file.version++; - instance.version!++; + file.modifiedTime = new Date(); + instance.version++; if (!instance.modifiedFiles) { instance.modifiedFiles = new Map(); } @@ -441,8 +497,7 @@ export function makeWatchHost( const readFileWithFallback = ( filePath: string, encoding?: string | undefined - ): string | undefined => - compiler.sys.readFile(filePath, encoding) || readFile(filePath, encoding); + ): string | undefined => readFileWithInstance(instance, filePath, encoding); const moduleResolutionHost: ModuleResolutionHost = { fileExists, @@ -575,6 +630,16 @@ export function makeWatchHost( } } +function normalizeSlashes(file: string): string { + return file.replace(/\\/g, '/'); +} + +interface ConfigFileInfo { + config: typescript.ParsedCommandLine | undefined; + outputFileNames?: Map; + tsbuildInfoFile?: string; +} + /** * Create the TypeScript Watch host */ @@ -647,8 +712,11 @@ export function makeSolutionBuilderHost( compiler.sys.newLine )}${newLine + newLine}` ); - const tsbuildinfos = [] as typescript.OutputFile[]; - const outputFiles = new Map(); + const tsbuildinfos = new Map(); + const outputFiles = new Map(); + const outputAffectingInstanceVersion = new Map(); + + const configFileInfo = new Map(); const solutionBuilderHost: SolutionBuilderWithWatchHost = { ...compiler.createSolutionBuilderWithWatchHost( compiler.sys, @@ -661,31 +729,117 @@ export function makeSolutionBuilderHost( ...createWatchFactory(beforeWatchCallbacks), // Overrides getCurrentDirectory, + // behave as if there is no tsbuild info on disk since we want to generate all outputs in memory and only use those + readFile: (fileName, encoding) => { + const outputFile = getOutputFileFromReferencedProject(fileName); + return outputFile !== undefined + ? outputFile + ? outputFile.text + : undefined + : readInputFile(fileName, encoding).text; + }, writeFile: (name, text, writeByteOrderMark) => { - compiler.sys.writeFile(name, text, writeByteOrderMark); updateFileWithText(instance, name, () => text); - if (name.endsWith('.tsbuildinfo')) { - tsbuildinfos.push({ - name, - text, - writeByteOrderMark: !!writeByteOrderMark - }); + const map = name.endsWith('.tsbuildinfo') ? tsbuildinfos : outputFiles; + const resolvedFileName = path.resolve(name); + const existing = map.get(resolvedFileName); + map.set(resolvedFileName, { + name, + text, + writeByteOrderMark: !!writeByteOrderMark, + time: new Date(), + isNew: true, + version: existing + ? existing.text !== text + ? existing.version + 1 + : existing.version + : 0 + }); + if ( + outputAffectingInstanceVersion.has(resolvedFileName) && + (!existing || existing.text !== text) + ) { + instance.version++; + } + }, + getModifiedTime: fileName => { + const outputFile = getOutputFileFromReferencedProject(fileName); + if (outputFile !== undefined) { + return outputFile ? outputFile.time : undefined; + } + const existing = + instance.files.get(path.resolve(fileName)) || + instance.otherFiles.get(path.resolve(fileName)); + return existing + ? existing.modifiedTime + : compiler.sys.getModifiedTime!(fileName); + }, + setModifiedTime: (fileName, time) => { + const outputFile = getOutputFileFromReferencedProject(fileName); + if (outputFile !== undefined) { + if (outputFile) { + outputFile.time = time; + } } else { - outputFiles.set(path.resolve(name), { - name, - text, - writeByteOrderMark: !!writeByteOrderMark - }); + compiler.sys.setModifiedTime!(fileName, time); + } + const existing = + instance.files.get(path.resolve(fileName)) || + instance.otherFiles.get(path.resolve(fileName)); + if (existing) { + existing.modifiedTime = time; + } + }, + fileExists: fileName => { + const outputFile = getOutputFileFromReferencedProject(fileName); + if (outputFile !== undefined) { + return true; } + if (isOutputFromReferencedProject(fileName)) { + return false; + } + const existing = + instance.files.get(path.resolve(fileName)) || + instance.otherFiles.get(path.resolve(fileName)); + return existing + ? existing.text !== undefined + : compiler.sys.fileExists(fileName); + }, + directoryExists: directory => { + if (compiler.sys.directoryExists(directory)) { + return true; + } + const resolvedDirectory = normalizeSlashes(path.resolve(directory)) + '/'; + for (const outputFile of outputFiles.keys()) { + if (normalizeSlashes(outputFile).startsWith(resolvedDirectory)) { + return true; + } + } + for (const tsbuildInfo of tsbuildinfos.keys()) { + if (normalizeSlashes(tsbuildInfo).startsWith(resolvedDirectory)) { + return true; + } + } + return false; }, setTimeout: undefined, clearTimeout: undefined, outputFiles, - tsbuildinfos + tsbuildinfos, + outputAffectingInstanceVersion, + getOutputFileFromReferencedProject, + getInputFileNameFromOutput: fileName => { + const result = getInputFileNameFromOutput(fileName); + return typeof result === 'string' ? result : undefined; + }, + getOutputFilesFromReferencedProjectInput }; solutionBuilderHost.trace = logData => log.logInfo(logData); - solutionBuilderHost.getParsedCommandLine = file => - getParsedCommandLine(compiler, instance.loaderOptions, file); + solutionBuilderHost.getParsedCommandLine = file => { + const config = getParsedCommandLine(compiler, instance.loaderOptions, file); + configFileInfo.set(path.resolve(file), { config }); + return config; + }; // make a (sync) resolver that follows webpack's rules const resolveSync = makeResolver(loader._compiler.options); @@ -712,6 +866,115 @@ export function makeSolutionBuilderHost( diagnostics.perFile.clear(); diagnostics.transpileErrors.length = 0; } + + function findOutputFile(fileName: string) { + const resolvedFileName = path.resolve(fileName); + return fileName.endsWith('.tsbuildinfo') + ? tsbuildinfos.get(resolvedFileName) + : outputFiles.get(resolvedFileName); + } + + function getInputFileNameFromOutput( + outputFileName: string + ): string | true | undefined { + const resolvedFileName = path.resolve(outputFileName); + for (const [configFile, configInfo] of configFileInfo.entries()) { + ensureInputOutputInfo(configFile, configInfo); + if (configInfo.outputFileNames) { + for (const [ + inputFileName, + outputFilesOfInput + ] of configInfo.outputFileNames.entries()) { + if (outputFilesOfInput.indexOf(resolvedFileName) !== -1) { + return inputFileName; + } + } + } + if ( + configInfo.tsbuildInfoFile && + path.resolve(configInfo.tsbuildInfoFile) === resolvedFileName + ) { + return true; + } + } + return undefined; + } + + function isOutputFromReferencedProject(fileName: string) { + return !!getInputFileNameFromOutput(fileName); + } + + function ensureInputOutputInfo( + configFile: string, + configInfo: ConfigFileInfo + ) { + if ( + configInfo.outputFileNames || + !configInfo.config || + path.resolve(configFile) === path.resolve(instance.configFilePath!) + ) { + return; + } + configInfo.outputFileNames = new Map(); + configInfo.config.fileNames.forEach(inputFile => + configInfo.outputFileNames!.set( + path.resolve(inputFile), + getOutputFileNames(instance, configInfo.config!, inputFile).map( + output => path.resolve(output) + ) + ) + ); + + configInfo.tsbuildInfoFile = instance.compiler + .getTsBuildInfoEmitOutputFilePath + ? instance.compiler.getTsBuildInfoEmitOutputFilePath( + configInfo.config.options + ) + : // before api + (instance.compiler as any).getOutputPathForBuildInfo( + configInfo.config.options + ); + } + + function getOutputFileFromReferencedProject( + outputFileName: string + ): OutputFile | false | undefined { + return ( + findOutputFile(outputFileName) || + (isOutputFromReferencedProject(outputFileName) ? false : undefined) + ); + } + + function getOutputFilesFromReferencedProjectInput(inputFileName: string) { + const resolvedFileName = path.resolve(inputFileName); + for (const [configFile, configInfo] of configFileInfo.entries()) { + ensureInputOutputInfo(configFile, configInfo); + if (configInfo.outputFileNames) { + const result = configInfo.outputFileNames.get(resolvedFileName); + if (result) { + return result + .map(outputFile => outputFiles.get(outputFile)!) + .filter(output => !!output); + } + } + } + return []; + } + + function readInputFile(inputFileName: string, encoding: string | undefined) { + const resolvedFileName = path.resolve(inputFileName); + const existing = instance.otherFiles.get(resolvedFileName); + if (existing) { + return existing; + } + const tsFile: TSFile = { + version: 1, + text: compiler.sys.readFile(inputFileName, encoding), + modifiedTime: compiler.sys.getModifiedTime!(inputFileName) + }; + instance.otherFiles.set(resolvedFileName, tsFile); + return tsFile; + } } export function getSolutionErrors(instance: TSInstance, context: string) { diff --git a/src/utils.ts b/src/utils.ts index d64c119e8..46585ebe0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -235,9 +235,6 @@ export function arrify(val: T | T[]) { } export function ensureProgram(instance: TSInstance) { - if (instance.solutionBuilder) { - instance.solutionBuilder.buildReferences(instance.configFilePath!); - } if (instance && instance.watchHost) { if (instance.hasUnaccountedModifiedFiles) { if (instance.changedFilesList) { @@ -358,11 +355,14 @@ export function validateSourceMapOncePerProject( } } -export function supportsSolutionBuild( - loaderOptions: LoaderOptions, - compiler: typeof typescript -) { - return !!loaderOptions.projectReferences && !!compiler.InvalidatedProjectKind; +export function supportsSolutionBuild(instance: TSInstance) { + return ( + !!instance.configFilePath && + !!instance.loaderOptions.projectReferences && + !!instance.compiler.InvalidatedProjectKind && + !!instance.configParseResult.projectReferences && + !!instance.configParseResult.projectReferences.length + ); } /** diff --git a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.8/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.8/output.transpiled.txt index f00582869..c696028f0 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.8/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.8/output.transpiled.txt @@ -1,12 +1,8 @@ Asset Size Chunks Chunk Names bundle.js 4.37 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} [built] [2 errors] +[./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'. - -ERROR in [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.8/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.8/output.txt index 2629a55d0..a167bb281 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.8/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference/expectedOutput-3.8/output.txt @@ -7,16 +7,12 @@ Entrypoint main = bundle.js ERROR in ./lib/index.ts Module build failed (from /index.js): 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) + at makeSourceMapAndFinish (dist\index.js:106:18) + at successLoader (dist\index.js:92:9) + at Object.loader (dist\index.js:43:5) @ ./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 lib\index.ts ./lib/index.ts -[tsl] ERROR in lib\index.ts(6,7) +[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_WatchApi/expectedOutput-3.8/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference_WatchApi/expectedOutput-3.8/output.transpiled.txt index 1b2499099..c696028f0 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference_WatchApi/expectedOutput-3.8/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference_WatchApi/expectedOutput-3.8/output.transpiled.txt @@ -1,12 +1,8 @@ Asset Size Chunks Chunk Names bundle.js 4.37 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} [built] [2 errors] +[./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_WatchApi/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SemanticErrorInReference_WatchApi/lib/index.ts'. - -ERROR in [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_WatchApi/expectedOutput-3.8/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference_WatchApi/expectedOutput-3.8/output.txt index a9446a546..3fc6b9b77 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference_WatchApi/expectedOutput-3.8/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SemanticErrorInReference_WatchApi/expectedOutput-3.8/output.txt @@ -7,16 +7,12 @@ Entrypoint main = bundle.js ERROR in ./lib/index.ts Module build failed (from /index.js): 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) + at makeSourceMapAndFinish (dist\index.js:106:18) + at successLoader (dist\index.js:92:9) + at Object.loader (dist\index.js:43:5) @ ./app.ts 3:12-28 -ERROR in tsconfig.json -[tsl] ERROR - TS6305: Output file '/.test/projectReferencesNotBuilt_SemanticErrorInReference_WatchApi/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SemanticErrorInReference_WatchApi/lib/index.ts'. - ERROR in lib\index.ts ./lib/index.ts -[tsl] ERROR in lib\index.ts(6,7) +[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.8/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.8/output.transpiled.txt index 07bb3ce02..b247cbbdc 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.8/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.8/output.transpiled.txt @@ -1,12 +1,8 @@ Asset Size Chunks Chunk Names bundle.js 4.36 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} [built] [2 errors] +[./app.ts] 167 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 [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 diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.8/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.8/output.txt index fdd0dfe4c..96387d70b 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.8/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference/expectedOutput-3.8/output.txt @@ -7,16 +7,12 @@ Entrypoint main = bundle.js ERROR in ./lib/index.ts Module build failed (from /index.js): 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) + at makeSourceMapAndFinish (dist\index.js:106:18) + at successLoader (dist\index.js:92:9) + at Object.loader (dist\index.js:43:5) @ ./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 lib\index.ts ./lib/index.ts -[tsl] ERROR in lib\index.ts(4,12) +[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_WatchApi/expectedOutput-3.8/output.transpiled.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference_WatchApi/expectedOutput-3.8/output.transpiled.txt index 7de607cf2..b247cbbdc 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference_WatchApi/expectedOutput-3.8/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference_WatchApi/expectedOutput-3.8/output.transpiled.txt @@ -1,12 +1,8 @@ Asset Size Chunks Chunk Names bundle.js 4.36 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} [built] [2 errors] +[./app.ts] 167 bytes {main} [built] [1 error] [./lib/index.ts] 134 bytes {main} [built] -ERROR in tsconfig.json -[tsl] ERROR - TS6305: Output file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference_WatchApi/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference_WatchApi/lib/index.ts'. - -ERROR in [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 diff --git a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference_WatchApi/expectedOutput-3.8/output.txt b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference_WatchApi/expectedOutput-3.8/output.txt index 40fb18df5..bd7d096ab 100644 --- a/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference_WatchApi/expectedOutput-3.8/output.txt +++ b/test/comparison-tests/projectReferencesNotBuilt_SyntaxErrorInReference_WatchApi/expectedOutput-3.8/output.txt @@ -7,16 +7,12 @@ Entrypoint main = bundle.js ERROR in ./lib/index.ts Module build failed (from /index.js): 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) + at makeSourceMapAndFinish (dist\index.js:106:18) + at successLoader (dist\index.js:92:9) + at Object.loader (dist\index.js:43:5) @ ./app.ts 3:12-28 -ERROR in tsconfig.json -[tsl] ERROR - TS6305: Output file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference_WatchApi/lib/index.d.ts' has not been built from source file '/.test/projectReferencesNotBuilt_SyntaxErrorInReference_WatchApi/lib/index.ts'. - ERROR in lib\index.ts ./lib/index.ts -[tsl] ERROR in lib\index.ts(4,12) +[tsl] ERROR in lib\index.ts(4,12)  TS1136: Property assignment expected. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/bundle.js b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/bundle.js index 60f7f137c..7b491a754 100644 --- a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/bundle.js +++ b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/bundle.js @@ -94,19 +94,19 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/out/index.js\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); +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/out/index.js": -/*!**************************!*\ - !*** ./lib/out/index.js ***! - \**************************/ +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nexports.__esModule = true;\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n};\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./lib/out/index.js?"); +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/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/bundle.transpiled.js b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/bundle.transpiled.js index a4bc091aa..a59c4688b 100644 --- a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/bundle.transpiled.js +++ b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/bundle.transpiled.js @@ -94,19 +94,19 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/out/index.js\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\n\n\n//# sourceURL=webpack:///./app.ts?"); +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/out/index.js": -/*!**************************!*\ - !*** ./lib/out/index.js ***! - \**************************/ +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nexports.__esModule = true;\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n};\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./lib/out/index.js?"); +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/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/output.transpiled.txt b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/output.transpiled.txt index cef6997fc..f31c64018 100644 --- a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/output.transpiled.txt +++ b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/output.transpiled.txt @@ -1,5 +1,5 @@ Asset Size Chunks Chunk Names -bundle.js 4.37 KiB main [emitted] main +bundle.js 4.35 KiB main [emitted] main Entrypoint main = bundle.js [./app.ts] 167 bytes {main} [built] -[./lib/out/index.js] 130 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/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/output.txt b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/output.txt index 6a20f74f6..64fcf5538 100644 --- a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/output.txt +++ b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/output.txt @@ -1,7 +1,7 @@ Asset Size Chunks Chunk Names - bundle.js 4.34 KiB main [emitted] main + bundle.js 4.29 KiB main [emitted] main ../lib/out/index.d.ts 89 bytes [emitted] ../lib/out/tsconfig.tsbuildinfo 70 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/out/index.js] 130 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/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/patch0/output.txt index 45d8f7737..87bcb1776 100644 --- a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/patch0/output.txt @@ -1,7 +1,7 @@ - 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] + Asset Size Chunks Chunk Names + bundle.js 4.33 KiB main [emitted] main + ../lib/out/index.d.ts 108 bytes [emitted] +../lib/out/tsconfig.tsbuildinfo 70 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] [./lib/index.ts] 136 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/patch3/output.txt b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/patch3/output.txt index c4dd65cf6..0408330b4 100644 --- a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/patch3/output.txt +++ b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-3.8/patch3/output.txt @@ -1,7 +1,7 @@ - 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] + Asset Size Chunks Chunk Names + bundle.js 4.36 KiB main [emitted] main + ../lib/out/index.d.ts 127 bytes [emitted] +../lib/out/tsconfig.tsbuildinfo 70 KiB [emitted] Entrypoint main = bundle.js [./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/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.8/patch0/output.txt index 1c3d5bb27..1b5e06e91 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.8/patch0/output.txt @@ -4,6 +4,6 @@ ../lib/index.d.ts 89 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 131 bytes {main} [built] +[./app.ts] 131 bytes {main} [./lib/helper.ts] 121 bytes {main} [built] -[./lib/index.ts] 197 bytes {main} \ No newline at end of file +[./lib/index.ts] 197 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/output.txt index 8486d9d82..ad0d1d354 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/output.txt @@ -1,6 +1,9 @@ - Asset Size Chunks Chunk Names -bundle.js 4.77 KiB main [emitted] main + Asset Size Chunks Chunk Names + bundle.js 4.8 KiB main [emitted] main + ../lib/helper.d.ts 92 bytes [emitted] + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/helper.ts] 100 bytes {main} [built] -[./lib/index.ts] 189 bytes {main} [built] \ No newline at end of file +[./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.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/patch0/output.txt index ee2f58669..734cb3fac 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/patch0/output.txt @@ -1,9 +1,8 @@ Asset Size Chunks Chunk Names - bundle.js 4.8 KiB main [emitted] main - ../lib/helper.d.ts 92 bytes [emitted] + bundle.js 4.82 KiB main [emitted] main ../lib/index.d.ts 108 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/helper.ts] 100 bytes {main} +[./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.8/patch1/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/patch1/output.txt index 7e9c5b9b0..4137e4207 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/patch1/output.txt @@ -4,6 +4,6 @@ ../lib/index.d.ts 108 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 131 bytes {main} [built] +[./app.ts] 131 bytes {main} [./lib/helper.ts] 121 bytes {main} [built] -[./lib/index.ts] 211 bytes {main} \ No newline at end of file +[./lib/index.ts] 211 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/output.txt index 5645df8f1..e73b7c2b1 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/output.txt @@ -1,8 +1,11 @@ - Asset Size Chunks Chunk Names - bundle.js 4.77 KiB main [emitted] main - ../app.d.ts 11 bytes [emitted] -../tsconfig.tsbuildinfo 51.8 KiB [emitted] + Asset Size Chunks Chunk Names + bundle.js 4.8 KiB main [emitted] main + ../app.d.ts 11 bytes [emitted] + ../tsconfig.tsbuildinfo 51.8 KiB [emitted] + ../lib/helper.d.ts 92 bytes [emitted] + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/helper.ts] 100 bytes {main} [built] -[./lib/index.ts] 189 bytes {main} [built] \ No newline at end of file +[./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_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt index 7db149fe5..e17a418d1 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt @@ -1,10 +1,9 @@ Asset Size Chunks Chunk Names - bundle.js 4.8 KiB main [emitted] main + bundle.js 4.82 KiB main [emitted] main ../app.d.ts 11 bytes [emitted] - ../lib/helper.d.ts 92 bytes [emitted] ../lib/index.d.ts 108 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/helper.ts] 100 bytes {main} +[./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_Composite_WatchApi/expectedOutput-3.8/patch1/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch1/output.txt index 4df8353e2..4036a0cf2 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch1/output.txt @@ -7,4 +7,4 @@ Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [./lib/helper.ts] 121 bytes {main} [built] -[./lib/index.ts] 211 bytes {main} \ No newline at end of file +[./lib/index.ts] 211 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/output.txt index 8486d9d82..ad0d1d354 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/output.txt @@ -1,6 +1,9 @@ - Asset Size Chunks Chunk Names -bundle.js 4.77 KiB main [emitted] main + Asset Size Chunks Chunk Names + bundle.js 4.8 KiB main [emitted] main + ../lib/helper.d.ts 92 bytes [emitted] + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/helper.ts] 100 bytes {main} [built] -[./lib/index.ts] 189 bytes {main} [built] \ No newline at end of file +[./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_WatchApi/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/patch0/output.txt index ee2f58669..734cb3fac 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/patch0/output.txt @@ -1,9 +1,8 @@ Asset Size Chunks Chunk Names - bundle.js 4.8 KiB main [emitted] main - ../lib/helper.d.ts 92 bytes [emitted] + bundle.js 4.82 KiB main [emitted] main ../lib/index.d.ts 108 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] -[./lib/helper.ts] 100 bytes {main} +[./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_WatchApi/expectedOutput-3.8/patch1/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/patch1/output.txt index 24bc679a7..4137e4207 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/patch1/output.txt @@ -6,4 +6,4 @@ Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [./lib/helper.ts] 121 bytes {main} [built] -[./lib/index.ts] 211 bytes {main} \ No newline at end of file +[./lib/index.ts] 211 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt index 6a22a2be6..5bf34afaf 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt @@ -7,4 +7,4 @@ Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [./lib/helper.ts] 121 bytes {main} [built] -[./lib/index.ts] 197 bytes {main} \ No newline at end of file +[./lib/index.ts] 197 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-3.8/patch0/output.txt index f4f1ffdbd..1b5e06e91 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-3.8/patch0/output.txt @@ -6,4 +6,4 @@ Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [./lib/helper.ts] 121 bytes {main} [built] -[./lib/index.ts] 197 bytes {main} \ No newline at end of file +[./lib/index.ts] 197 bytes {main} [built] \ No newline at end of file