Transforming TypeScript into JavaScript

前端 未结 11 1243
再見小時候
再見小時候 2020-12-08 02:01

I\'m wondering how is it possible to transform the TypeScript into JavaScript in a cross platform manner. I\'m aware about availability of node package manager for typescrip

11条回答
  •  囚心锁ツ
    2020-12-08 02:44

    This is what worked for me:

    First, installed the typescript node module >> npm install -g typescript. This gives a command line utility tsc.

    Next, tsc gulpfile.ts gulp-config.ts typings/tsd.d.ts

    • this will transpile the gulpfile.ts and gulp-config.ts files to gulpfile.js and gulp-config.js. We supply the typings/tsd.d.ts file as reference for correct transpilation.
    • The typescript node module covers many options >> tsc -h to specify output directory or file, etc..

    Hope this helps.

提交回复
热议问题