pass hash function to cssHash

pull/6026/head
Rich Harris 6 years ago
parent 920bbae708
commit 8ea3bb2631

@ -275,8 +275,8 @@ class Atrule {
}
}
const get_default_css_hash: CssHashGetter = ({ hash }) => {
return `svelte-${hash}`;
const get_default_css_hash: CssHashGetter = ({ css, hash }) => {
return `svelte-${hash(css)}`;
};
export default class Stylesheet {
@ -317,7 +317,8 @@ export default class Stylesheet {
this.id = get_css_hash({
filename,
name: component_name,
hash: hash(ast.css.content.styles)
css: ast.css.content.styles,
hash
});
this.has_styles = true;

@ -107,7 +107,8 @@ export type ModuleFormat = 'esm' | 'cjs';
export type CssHashGetter = (args: {
name: string;
filename: string | undefined;
hash: string;
css: string;
hash: (input: string) => string;
}) => string;
export interface CompileOptions {

Loading…
Cancel
Save