Skip to content

tsc gives bad typings when compiling directly from angular/modules/angular2 #1

@uber5001

Description

@uber5001

When trying to transpile the angular2 sources directly through:

tsc -p angular/modules/angular2 --outDir dist/node_modules/angular2

some of the resulting .d.ts files attempt to make a reference that assumes they did not move.

For example, the .d.ts from angular/modules/angular2/src/di/injector.d.ts attempts to reference angular/modules/angular2/typings/es6-promise/es6-promise.d.ts. Instead of taking the shortest relative reference ( ../../typings/es6-promise/es6-promise.d.ts ), it tries this:

/// <reference path="../../../../../angular/modules/angular2/typings/es6-promise/es6-promise.d.ts" />

This causes issues when angular2 is no longer in the angular/modules/ directory.

Solution

I have no idea why this works, but if angular2/is moved out of angular/modules/ before transpiling, these weird reference issues go away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions