Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Add an option to entirely disable sourcemap generation #208

Closed
ascott18 opened this issue Aug 24, 2022 · 1 comment
Closed

Add an option to entirely disable sourcemap generation #208

ascott18 opened this issue Aug 24, 2022 · 1 comment

Comments

@ascott18
Copy link

ascott18 commented Aug 24, 2022

I'm having troubles with the generated sourcemaps being wrong. When I try to set a breakpoint in some part of my SFC's <script> block, it is getting mapped to the <style> chunk.

It would be great if we could have the option to just disable the source maps entirely, since I really don't find them necessary anyway. The raw output of the template compiler is perfectly readable and understandable in serve mode since no minification is being performed.

At the moment, I'm doing this as a workaround:

(() => {
var plugin = createVuePlugin();
const oldTransform = plugin.transform;
plugin.transform = async function(code, id, options) {
  var result = await oldTransform?.call(this, code, id, options);
  if (typeof result == "object") delete result.map;
  return result;
}
return plugin;
})()
@ascott18
Copy link
Author

Disregard - I didn't see the notice about https://github.com/vitejs/vite-plugin-vue2 being created, which doesn't seem to have this problem (and also has such an option).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant