onebay / vite-plugin-imp

A vite plugin for import library component style automatic.
MIT License
232 stars 24 forks source link

sourcemap is wrong #23

Closed agileago closed 2 years ago

agileago commented 2 years ago

我用了之后,发现sourcemap断点断不上了, 我把代码中的要返回的map手动置成null, 就正常了,最好提供一个选型配置一下是否要返回sourcemap

https://github.com/agileago/fe-template

psaren commented 2 years ago

我用了之后,发现sourcemap断点断不上了, 我把代码中的要返回的map手动置成null, 就正常了,最好提供一个选型配置一下是否要返回sourcemap

https://github.com/agileago/fe-template

当然可以提供这个配置 请提供下复现路径,确定下最佳的解决方案

agileago commented 2 years ago
  1. clone https://github.com/agileago/fe-template
  2. pnpm install
  3. pnpm run dev
  4. 点击页面的 go to count
  5. 在devtools中 ctrl + p 搜索 count.view.tsx
  6. 然后断点12行会发现断点不上 2021-12-28 11 59 38
  7. 把sourcemap手动重置为null, 删除 node_modules下的.vite缓存,重新运行
  8. 然后重新断点,会发现一切正常 2021-12-28 12 02 50
psaren commented 2 years ago

24 应该可以解决这个问题

agileago commented 2 years ago

perfect.发个版

agileago commented 2 years ago

找到原因了么

agileago commented 2 years ago

是不是搞错了,我是说传入一个选项 关闭掉插件的sourcemap,不是说关闭整个vite的sourcemap

psaren commented 2 years ago

我构建新版本是可以解决了

psaren commented 2 years ago

是不是搞错了,我是说传入一个选项 关闭掉插件的sourcemap,不是说关闭整个vite的sourcemap

这不会影响vite的sourcemap,只处理了引用库的文件

psaren commented 2 years ago

perfect.发个版

发了

GuichiZhao commented 2 years ago

还是不行,禁掉这个插件之后vite的sourcemap就正常了

psaren commented 2 years ago

还是不行,禁掉这个插件之后vite的sourcemap就正常了

提供下复现仓库/在线demo吧