Simplify add-default-export plugin (#18179)
This commit is contained in:
1 parent
4910e18167
commit
55d8df886e
1 file changed
+2
-4
@@ -1,6 +1,6 @@
|
||||
import path from "node:path";
|
||||
|
||||
const PLUGIN_NAMESPACE = "with-default-export";
|
||||
const PLUGIN_NAMESPACE = "add-default-export";
|
||||
export default function esbuildPluginAddDefaultExport() {
|
||||
return {
|
||||
name: "addDefaultExport",
|
||||
@@ -30,10 +30,8 @@ export default function esbuildPluginAddDefaultExport() {
|
||||
|
||||
return {
|
||||
contents: /* indent */ `
|
||||
import * as namespace from ${source};
|
||||
|
||||
export * from ${source};
|
||||
export default namespace;
|
||||
export * as default from ${source};
|
||||
`,
|
||||
resolveDir: path.dirname(file),
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user