Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourcemap inline doesn't work when using API #3913

Closed
electerious opened this issue Dec 24, 2020 · 8 comments · Fixed by #4605 or #4549
Closed

sourcemap inline doesn't work when using API #3913

electerious opened this issue Dec 24, 2020 · 8 comments · Fixed by #4605 or #4549

Comments

@electerious
Copy link

electerious commented Dec 24, 2020

  • 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.

@shellscape
Copy link
Contributor

Thanks for opening an issue. Citing the issue template:

Issues without minimal reproductions will be closed! Please provide a link to one by:

  1. Using the REPL at https://rollupjs.org/repl/, or
  2. Using the REPL.it reproduction template at https://repl.it/@rollup/rollup-repro
    (allows full use of all rollup options and plugins), or
  3. Provide a minimal repository link (Read https://git.io/fNzHA for instructions).
    These may take more time to triage than the other options.

Please add a reproduction and we'll be happy to triage further.

@electerious
Copy link
Author

@shellscape
Copy link
Contributor

thank you

@shellscape shellscape reopened this Dec 24, 2020
@lukastaegert lukastaegert added this to To do in Release 3.0.0 via automation Mar 22, 2021
@lukastaegert lukastaegert moved this from To do to In progress in Release 3.0.0 Jul 31, 2022
@lukastaegert lukastaegert moved this from In progress to To do in Release 3.0.0 Jul 31, 2022
@lukastaegert lukastaegert moved this from To do to In progress in Release 3.0.0 Aug 11, 2022
@lukastaegert lukastaegert moved this from In progress to Ready for merge in Release 3.0.0 Aug 13, 2022
@lukastaegert
Copy link
Member

Finally: Fix at #4605

@lukastaegert lukastaegert moved this from Ready for merge to Done in Release 3.0.0 Aug 15, 2022
@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4605 as part of rollup@3.0.0-6. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@3.0.0-6 or npm install rollup@beta. It will likely become part of a regular release later.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4605 as part of rollup@3.0.0-7. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@3.0.0-7 or npm install rollup@beta. It will likely become part of a regular release later.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4605 as part of rollup@3.0.0-8. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@3.0.0-8 or npm install rollup@beta. It will likely become part of a regular release later.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4605 as part of rollup@3.0.0. You can test it via npm install rollup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Release 3.0.0
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants