Skip to content

Commit 5ed3b14

Browse files
committed
Add default export for code-input.mjs
1 parent 8f9ec91 commit 5ed3b14

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

esm/generate.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const AUTOGENERATED_NOTICE = "// NOTICE: This code is @generated from code outsi
3333
await codeInputMjs.writeFile("export const Template = codeInput.Template;\n");
3434
await codeInputMjs.writeFile("export const CodeInput = codeInput.CodeInput;\n");
3535
await codeInputMjs.writeFile("export const registerTemplate = codeInput.registerTemplate;\n");
36+
await codeInputMjs.writeFile("export default { Plugin, Template, CodeInput, registerTemplate };\n");
3637

3738
codeInputJs.close();
3839
codeInputMjs.close();
@@ -57,6 +58,7 @@ const AUTOGENERATED_NOTICE = "// NOTICE: This code is @generated from code outsi
5758
copyingCode = true; // After is code to copy - this line missed out
5859
}
5960
}
61+
await codeInputDMts.writeFile("export default { Plugin, Template, CodeInput, registerTemplate };\n");
6062

6163
await codeInputDTs.close();
6264
await codeInputDMts.close();

esm/generate.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ AUTOGENERATED_NOTICE="// NOTICE: This code is @generated from code outside the e
2020
echo "export const Template = codeInput.Template;" >> code-input.mjs
2121
echo "export const CodeInput = codeInput.CodeInput;" >> code-input.mjs
2222
echo "export const registerTemplate = codeInput.registerTemplate;" >> code-input.mjs
23+
echo "export default { Plugin, Template, CodeInput, registerTemplate };" >> code-input.mjs
2324

2425
# code-input.d.mts: (../code-input.d.ts without the plugin/template namespaces) + ESM
2526
echo $AUTOGENERATED_NOTICE > code-input.d.mts
@@ -31,6 +32,7 @@ AUTOGENERATED_NOTICE="// NOTICE: This code is @generated from code outside the e
3132
head -$(($(sed -n "/ESM-SUPPORT-START-NAMESPACE-2/=" ../code-input.d.ts | head -1) - 1)) ../code-input.d.ts | tail --line=+$(($(sed -n "/ESM-SUPPORT-END-NAMESPACE-1/=" ../code-input.d.ts | head -1) + 1)) >> code-input.d.mts
3233
# Code after second namespace
3334
tail --line=+$(($(sed -n "/ESM-SUPPORT-END-NAMESPACE-2/=" ../code-input.d.ts | head -1) + 1)) ../code-input.d.ts >> code-input.d.mts
35+
echo "export default { Plugin, Template, CodeInput, registerTemplate };" >> code-input.d.mts
3436

3537
# Templates
3638
mkdir -p templates

0 commit comments

Comments
 (0)