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

34 lines
807 B

import { magic_string_bundle } from '../../helpers';
export const component_filepath = 'src/input.svelte';
export const component_file_basename = 'input.svelte';
// as output by external tool for src/external_code.css (relative to src/input.svelte)
export const external_relative_filename = 'external_code.css';
const external_code = `
span {
--external_code-var: 1px;
}
`;
export default {
css_map_sources: [external_relative_filename],
js_map_sources: [],
preprocess: [
{
style: ({ content, filename }) => {
const external = `/* Filename from preprocess: ${filename} */` + external_code;
return magic_string_bundle([
{ code: external, filename: external_relative_filename },
{ code: content, filename }
]);
}
}
],
options: {
filename: component_filepath
}
};