feat: hashing css names by filename

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

@ -70,8 +70,10 @@ const component_options = {
return input; return input;
}), }),
cssHash: fun(({ css, hash }) => { cssHash: fun(({ css, filename, name, hash }) => {
return `svelte-${hash(css)}`; //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 // TODO this is a sourcemap option, would be good to put under a sourcemap namespace

Loading…
Cancel
Save