Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix: add offset
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 25, 2022
1 parent 0af845c commit 83bf655
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuxt/src/components/tree-shake.ts
Expand Up @@ -56,7 +56,7 @@ export const TreeShakeTemplatePlugin = createUnplugin((options: TreeShakeTemplat

try {
// Replace node content
const text = fallback ? code.slice(fallback.loc[0].start, fallback.loc[fallback.loc.length - 1].end) : ''
const text = fallback ? code.slice(template.index + fallback.loc[0].start, template.index + fallback.loc[fallback.loc.length - 1].end) : ''
s.overwrite(template.index + node.loc[0].end, template.index + node.loc[node.loc.length - 1].start, text)
} catch (err) {
// This may fail if we have a nested client-only component and are trying
Expand Down

0 comments on commit 83bf655

Please sign in to comment.