Definitelytyped: jspm (system) and npm @types

Created on 11 Jul 2016  路  6Comments  路  Source: DefinitelyTyped/DefinitelyTyped

  • [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] I want to talk about @types, npm and jspm.

what is the best way to use npm @types instead of typings or tsd, alongside with jspm?

  • should I keep installing the types using npm, and leave jspm do it's thing for the resulting .js files?
  • should I use the plugin-typescript and install types using jspm?
  • should I always keep types in a separate folder, using typings then reference them in plugin-typescript?
@types

All 6 comments

@RyanCavanaugh ?

// cc: @frankwallis

did anybody have an answer to this?

Related https://github.com/Microsoft/TypeScript/issues/6012

I think currently the best workaround is to install the package using both npm and jspm and manually keep their versions in sync. Other approachs:

https://github.com/alexisvincent/systemjs-tools/blob/master/docs/features.md#node_modules-package-resolution-beta
https://github.com/Microsoft/TypeScript/issues/6012#issuecomment-277549376

right now I'm installing the types using npm, setting tsconfig.json to output "module": "system" and then doing a jspm bundle on the resulting transpiled js files. not pretty, but works without duplication

@jrwpatterson I know it's not what you're looking for but my solution was to just stop using systemjs/jspm and use webpack instead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

victor-guoyu picture victor-guoyu  路  3Comments

variousauthors picture variousauthors  路  3Comments

ArtemZag picture ArtemZag  路  3Comments

Loghorn picture Loghorn  路  3Comments

csharpner picture csharpner  路  3Comments