Skip to content

situ2001/demo-rollup-sourcemap-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

demo

This is a demo of the rollup sourcemap issue introduced in rollup babel plugin with inputSourceMap: true option.

for information about the option, please refer to https://babeljs.io/docs/options#inputsourcemap

Steps to reproduce

Build

pnpm -r build

Go to ./my-app/dist to find dist index.js

Then, use one of the following websites to open the index.js file:

You will see that the source code mapping is incorrect. Since

  • Expected: babel transformed code ==sourcemap==> input code(in this case, js dist from foo package)
  • Actual: babel transformed code ==sourcemap==> source code of input code(in this case, ts code from foo package), not input code itself

How to fix

Go to ./my-app/rollup.config.mjs and set inputSourceMap: false in the babel plugin options.

About

This is a demo of the rollup sourcemap issue introduced in rollup babel plugin.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published