ember-browserify icon indicating copy to clipboard operation
ember-browserify copied to clipboard

Notes on use with TypeScript

Open jamesarosen opened this issue 8 years ago • 1 comments

I used ember-browserify to add pkijs to a TypeScript project today. Here are some notes:

  1. add the library: yarn add pkijs --dev
  2. add the type declarations: yarn add @types/pkijs --dev
  3. add "npm:pkijs": [ "node_modules/pkijs" ], to compilerOptions.paths in tsconfig.json. This tells Typescript that when I import PKI from 'npm:pkijs', I'm getting node_modules/pkijs/src/index.js
  4. import PKI from 'npm:pkijs' in a component/route/model/...

I don't know where this information might be useful -- possibly in the README.

jamesarosen avatar Sep 28 '17 19:09 jamesarosen

At a minimum it’s helpful to me as the maintainer of ember-cli-typescript – thanks for writing it up! I’ll add the note about using the paths option this way to that README later today!

chriskrycho avatar Oct 20 '17 12:10 chriskrycho