Skip to content

Commit

Permalink
fix: issues with emitting declarationMap
Browse files Browse the repository at this point in the history
Closes #1464
  • Loading branch information
alan-agius4 committed Jun 11, 2020
1 parent c865997 commit 38ad52b
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 43 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion integration/samples/typings/src/nested/reference/index.ts
@@ -1,3 +1,3 @@
/// <reference path="./mocked.d.ts" />
/// <reference path="./mocked.ts" />

export const faz: Mocked = { foo: 'bar' };
2 changes: 1 addition & 1 deletion integration/samples/typings/src/validator.ts
@@ -1,4 +1,4 @@
/// <reference path="./chalk.d.ts" />
/// <reference path="./chalk.ts" />
import * as chalk from 'chalk';

export { chalk };
4 changes: 2 additions & 2 deletions src/lib/ng-package/entry-point/compile-ngc.transform.ts
Expand Up @@ -8,7 +8,7 @@ import * as log from '../../utils/log';
import { isEntryPointInProgress, EntryPointNode, isEntryPoint } from '../nodes';
import { StylesheetProcessor } from '../../styles/stylesheet-processor';

export const compileNgcTransform: Transform = transformFromPromise(async (graph) => {
export const compileNgcTransform: Transform = transformFromPromise(async graph => {
log.info(`Compiling TypeScript sources through ngc`);
const entryPoint = graph.find(isEntryPointInProgress()) as EntryPointNode;
const entryPoints = graph.filter(isEntryPoint) as EntryPointNode[];
Expand All @@ -30,10 +30,10 @@ export const compileNgcTransform: Transform = transformFromPromise(async (graph)
stylesheetProcessor,
{
outDir: path.dirname(esm2015),
declarationDir: path.dirname(declarations),
declaration: true,
target: ts.ScriptTarget.ES2015,
},
path.dirname(declarations),
ngccProcessor,
);

Expand Down
5 changes: 0 additions & 5 deletions src/lib/ngc/compile-source-files.ts
@@ -1,7 +1,6 @@
import * as ng from '@angular/compiler-cli';
import * as ts from 'typescript';
import * as log from '../utils/log';
import { redirectWriteFileCompilerHost } from '../ts/redirect-write-file-compiler-host';
import { cacheCompilerHost } from '../ts/cache-compiler-host';
import { StylesheetProcessor } from '../styles/stylesheet-processor';
import { BuildGraph } from '../graph/build-graph';
Expand All @@ -16,7 +15,6 @@ export async function compileSourceFiles(
moduleResolutionCache: ts.ModuleResolutionCache,
stylesheetProcessor: StylesheetProcessor,
extraOptions?: Partial<ng.CompilerOptions>,
declarationDir?: string,
ngccProcessor?: NgccProcessor,
) {
log.debug(`ngc (v${ng.VERSION.full})`);
Expand All @@ -31,9 +29,6 @@ export async function compileSourceFiles(
moduleResolutionCache,
stylesheetProcessor,
);
if (declarationDir) {
tsCompilerHost = redirectWriteFileCompilerHost(tsCompilerHost, tsConfigOptions.basePath, declarationDir);
}

if (tsConfigOptions.enableIvy && ngccProcessor) {
tsCompilerHost = ngccTransformCompilerHost(tsCompilerHost, tsConfigOptions, ngccProcessor, moduleResolutionCache);
Expand Down
33 changes: 0 additions & 33 deletions src/lib/ts/redirect-write-file-compiler-host.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/lib/ts/tsconfig.ts
Expand Up @@ -87,7 +87,6 @@ export const initializeTsConfig = (defaultTsConfig: ng.ParsedConfiguration, entr
flatModuleOutFile: `${entryPoint.flatModuleFile}.js`,
basePath,
rootDir: basePath,
declarationDir: basePath,
};

tsConfig.rootNames = [entryPoint.entryFilePath];
Expand Down

0 comments on commit 38ad52b

Please sign in to comment.