mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 11:35:28 +00:00
@@ -17,11 +17,8 @@ export default function create_manifest_data(cwd: string): ManifestData {
|
||||
|
||||
if (/preload/.test(source)) {
|
||||
try {
|
||||
const { stats } = svelte.compile(source, {
|
||||
generate: false,
|
||||
onwarn: () => {}
|
||||
});
|
||||
return !!stats.vars.find((variable: any) => variable.module && variable.export_name === 'preload');
|
||||
const { vars } = svelte.compile(source.replace(/<style\b[^>]*>[^]*?<\/style>/g, ''), { generate: false });
|
||||
return vars.some((variable: any) => variable.module && variable.export_name === 'preload');
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
@@ -346,4 +343,4 @@ function get_pattern(segments: Part[][], add_trailing_slash: boolean) {
|
||||
}).join('') +
|
||||
(add_trailing_slash ? '\\\/?$' : '$')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user