feat: hashing css names by filename

picks either filename or component name or css texts
pull/16697/head
Hari 6 days ago
parent bde51ed7dc
commit 08e9f1822f

@ -70,8 +70,10 @@ const component_options = {
return input;
}),
cssHash: fun(({ css, hash }) => {
return `svelte-${hash(css)}`;
cssHash: fun(({ css, filename, name, hash }) => {
//either use extracted filename or component name
filename = filename ? filename.replace(/^.*[\\/]/, '') : name;
return `svelte-${hash(filename ?? css )}`;
}),
// TODO this is a sourcemap option, would be good to put under a sourcemap namespace

Loading…
Cancel
Save