Skip to content

when tsconfig specifies inlineSourceMap: true then no sourcemap is generated #71

@TheRealPiotrP

Description

@TheRealPiotrP

What happens and why it is wrong

in my tsconfig.json I have inlineSourceMap: true. I also configured rollup to use sourcemap: 'inline'. Rollup builds occur without issue, but my resultant .js file contained an inline sourcemap for non-ts assets only. After much experimentation I found that I can re-enable sourceMaps for TS with the following configuration:

    typescript({
        tsconfigOverride: {
            compilerOptions: {
                sourceMap: true,
                inlineSourceMap: false,

This is not intuitive. I've already expressed that I want sourcemaps, and that I want rollup to generate an inline sourcemap. The plugin should ideally respect the inlineSourceMap option in tsconfig.json.

If this is not feasible [likely because it's hard to scrape out inline source maps from tsc output] then there should be an error displayed and rollup should fail, telling the user they must disable inlineSourceMap and enable sourceMap in their typescript overrides.

Environment

Not relevant

Versions

  • typescript: 2.7.2
  • rollup: 0.57.1
  • rollup-plugin-typescript2: 0.12.0

rollup.config.js

I'm only including the relevant portion.

Original:

    typescript({
        tsconfigOverride: {
            compilerOptions: {
                module: "ES2015"
            }
        }
    }),

With Workaround:

    typescript({
        tsconfigOverride: {
            compilerOptions: {
                sourceMap: true,
                inlineSourceMap: false,
                module: "ES2015"
            }
        }
    }),

tsconfig.json

{
	"compilerOptions": {
		// ...
		"inlineSourceMap": true,
		// ...
	},
        // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugSomething isn't working properlysolution: workaround availableThere is a workaround available for this issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions