Keep original typescript source maps after using browserify

前端 未结 6 1173
再見小時候
再見小時候 2020-12-13 10:23

Background: I am compiling 2 dependent TypeScript files to js, which produces also source maps (one source map per file) using tsc 1.0

I\'m using -m commonjs

6条回答
  •  庸人自扰
    2020-12-13 10:57

    tsify is a browserify plugin that is better and replaces e.g. typescriptifier.

    npm install tsify browserify watchify

    You use tsify like this:

    browserify src/index.ts -p tsify --debug -o build/index.js

    Notice that this supports browserify --debug switch, no extra tricks required. So you can also use it with watchify like this:

    watchify src/index.ts -p tsify --debug -o build/index.js

提交回复
热议问题