|
|
@ -12,6 +12,15 @@ async function bundle_code(entry) {
|
|
|
|
virtual({
|
|
|
|
virtual({
|
|
|
|
__entry__: entry
|
|
|
|
__entry__: entry
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'resolve-svelte',
|
|
|
|
|
|
|
|
resolveId(importee) {
|
|
|
|
|
|
|
|
if (importee.startsWith('svelte')) {
|
|
|
|
|
|
|
|
const entry = pkg.exports[importee.replace('svelte', '.')];
|
|
|
|
|
|
|
|
return path.resolve(entry.browser ?? entry.default);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
nodeResolve({
|
|
|
|
nodeResolve({
|
|
|
|
exportConditions: ['production', 'import', 'browser', 'default']
|
|
|
|
exportConditions: ['production', 'import', 'browser', 'default']
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -99,6 +108,7 @@ const without_hydration = await bundle_code(
|
|
|
|
{ filename: 'App.svelte' }
|
|
|
|
{ filename: 'App.svelte' }
|
|
|
|
).js.code
|
|
|
|
).js.code
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
if (!without_hydration.includes('current_hydration_fragment')) {
|
|
|
|
if (!without_hydration.includes('current_hydration_fragment')) {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.error(`✅ Hydration code treeshakeable`);
|
|
|
|
console.error(`✅ Hydration code treeshakeable`);
|
|
|
|