Skip to content

sourcemap inline doesn't work when using API #3913

@electerious

Description

@electerious
  • Rollup Version: 2.35.1
  • Operating System (or Browser): macOS 10.15.7
  • Node Version (if applicable): v14.5.0
const bundle = await rollup.rollup({
	input: filePath,
})
const { output } = await bundle.generate({
	format: 'iife',
	sourcemap: 'inline'
})

console.log(output[0].code) // Expect sourcemap to be part of the code (= inline)
console.log(output[0].map) // Sourcemap is only available via .map

See https://repl.it/@electerious/rollup-repro#index.js (run with node index.js)

Expected Behavior

I'm using the API and passing the sourcemap: 'inline' option to Rollup (output options). I've expected that the sourcemap is inline and therefore a part of output[0].code.

Actual Behavior

The sourcemap is only available via output[0].map, but not part of output[0].code.

That might be the correct behaviour when using the API, but there's nothing in the docs telling me that 'inline' won't work when using the API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions