Plugins: Typescript plugin creates sourcemaps with sourcesContent null

Created on 14 Mar 2020  路  3Comments  路  Source: rollup/plugins

  • Rollup Plugin Name: @rollup/plugin-typescript
  • Rollup Plugin Version: 4.0.0
  • Rollup Version: 2.0.6
  • Operating System: repl
  • Node Version: 10.19.0 (repl)

How Do We Reproduce?

https://repl.it/repls/AmpleDirtyContent (I like the name :smiley: )

Expected Behavior

Should include original typescript source code as sourcesContent in sourcemaps.

Actual Behavior

sourcesContent is null for typescript files.

t鹿 馃悶 bug 馃攲 plugin-typescript

Most helpful comment

A workaround is add "inlineSources": true, to your tsconfig.json.

This is because typescript compiler generated sourcemap uses path instead of content of your code. It seems rollup cannot process them. inlineSources will force compiler to emit the source contents alongside the sourcemaps within a single map file which rollup can work with it.

All 3 comments

A workaround is add "inlineSources": true, to your tsconfig.json.

This is because typescript compiler generated sourcemap uses path instead of content of your code. It seems rollup cannot process them. inlineSources will force compiler to emit the source contents alongside the sourcemaps within a single map file which rollup can work with it.

I think this can be closed, right?

I think it can be closed now.

Was this page helpful?
0 / 5 - 0 ratings