quasqui
Version:
The meta-framework suite designed from scratch for frontend-focused modern web development.
23 lines (21 loc) • 492 B
text/typescript
import type { Plugin } from 'rollup';
/**
* rollup-plugin-strip-source-mapping
*
* Remove any lingering source map comments
*/
export function rollupPluginStripSourceMapping(): Plugin {
return {
name: 'rollup-plugin-strip-source-mapping',
transform: code => {
const resolvedCode = code.replace(
/^\/\/#\s*sourceMappingURL=[a-zA-Z0-9-_\*\?\.\/\&=+%\s]+$/gm,
'',
);
return {
code: resolvedCode,
map: null,
};
},
};
}