We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2fab00 commit e39ff6fCopy full SHA for e39ff6f
src/index.ts
@@ -47,17 +47,17 @@ export const VueNamedExport: UnpluginInstance<Options | undefined, false> =
47
`export const ${resolvedName} = `,
48
)
49
50
- if (!options.removeDefault) {
51
- s.appendLeft(
52
- defaultExport.end!,
53
- `\nexport default ${resolvedName};`,
54
- )
55
- } else {
+ if (options.removeDefault) {
56
// hack Vite HMR
57
s.replace(
58
/const \{ default: updated, (.*) \} = mod/,
59
(_, $1) => `const { "${resolvedName}": updated, ${$1} } = mod`,
60
+ } else {
+ s.appendLeft(
+ defaultExport.end!,
+ `\nexport default ${resolvedName};`,
+ )
61
}
62
63
return generateTransform(s, id)
0 commit comments