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/sourcemap-names/_config.js

34 lines
1.2 KiB

import MagicString from 'magic-string';
import { magic_string_preprocessor_result, magic_string_replace_all } from '../../helpers';
export default {
preprocess: [
{
markup: ({ content, filename }) => {
const src = new MagicString(content);
magic_string_replace_all(src, 'baritone', 'bar');
magic_string_replace_all(src,'--bazitone', '--baz');
magic_string_replace_all(src,'old_name_1', 'temp_new_name_1');
magic_string_replace_all(src,'old_name_2', 'temp_new_name_2');
return magic_string_preprocessor_result(filename, src);
}
},
{
markup: ({ content, filename }) => {
const src = new MagicString(content);
magic_string_replace_all(src, 'temp_new_name_1', 'temp_temp_new_name_1');
magic_string_replace_all(src, 'temp_new_name_2', 'temp_temp_new_name_2');
return magic_string_preprocessor_result(filename, src);
}
},
{
markup: ({ content, filename }) => {
const src = new MagicString(content);
magic_string_replace_all(src, 'temp_temp_new_name_1', 'new_name_1');
magic_string_replace_all(src, 'temp_temp_new_name_2', 'new_name_2');
return magic_string_preprocessor_result(filename, src);
}
}
]
};