Skip to content

ES6 Modules and *.d.ts files with compiler #3658

Closed
@grofit

Description

@grofit

I am currently working with aurelia which uses ES6 module loading (System) and it is great as I do not need to worry about slapping reference tags everywhere. Now my IDEs (VS/Webstorm) know about the d.ts files so while I am developing they know what types come from where. i.e:

import {Aurelia} from "aurelia-framework"

export function configure(aurelia: Aurelia) {
  aurelia.use
    .standardConfiguration()
    .developmentLogging()
    .plugin('aurelia-animator-css');

  aurelia.start().then(a => a.setRoot());
}

It knows in the IDE that aurelia-framework is included within aurelia.d.ts which is in another folder in the solution. So this all resolves great and makes for a much better development experience, however the problem comes when I want to compile my TSC files outside of the IDE.

So for example I want to move all my /src/*.ts files to /dist/*.js files, now I am currently using gulp and gulp-typescript passing in the 1.5 beta tsc object for compilation, and it all compiles but the compiler throws up errors like:

src\animation-main.ts(1,23): error TS2307: Cannot find external module 'aurelia-framework'.

So I am unsure how to resolve this for the compiler, as the IDE knows its there, and there are no options for me to just tell the TSC where all the *.d.ts files live, so is there a way to deal with this? as the IDEs can do it, as they have outside knowledge of the descriptor files so is there some way to just tell to the compiler where all the d.ts files are?

Again just want to mention it currently outputs all the *.ts files as *.js files fine and it all works, its just it will spit out a lot of errors giving the impression its not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions