You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/sourcemaps/samples/preprocessed-markup/_preprocessor.js

16 lines
460 B

import MagicString from 'magic-string';
export const preprocessors = [{
markup: ({content, filename}) => {
const src = new MagicString(content);
const idx = content.indexOf("baritone");
src.overwrite(idx, idx+"baritone".length, "bar");
return {
code: src.toString(),
map: src.generateMap({
source: filename,
includeContent: false
})
};
}
}];