Skip to content

Instantly share code, notes, and snippets.

@Fedia
Created February 14, 2021 19:51
Show Gist options
  • Save Fedia/ae974af06846f7deb28b842ec1e9b138 to your computer and use it in GitHub Desktop.
Save Fedia/ae974af06846f7deb28b842ec1e9b138 to your computer and use it in GitHub Desktop.
// Hacky Rollup plugin to remove source maps from Svelte components compiled for SSR
const killSSRmaps = {
renderChunk(code) {
return {
code: code.replace(/,[\s\n]*map:\s*(["'])\{.+?\}\1/g, ""),
};
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment