diff --git a/src/commands/build.ts b/src/commands/build.ts index dd668f0..1d2dfc1 100644 --- a/src/commands/build.ts +++ b/src/commands/build.ts @@ -54,7 +54,8 @@ export default defineCommand({ { input: 'src/runtime/', outDir: `${outDir}/runtime`, - ext: 'mjs', + addRelativeDeclarationExtensions: true, + ext: 'js', esbuild: { jsxImportSource: 'vue', jsx: 'automatic', diff --git a/test/__snapshots__/JsxComponent.mjs b/test/__snapshots__/JsxComponent.js similarity index 100% rename from test/__snapshots__/JsxComponent.mjs rename to test/__snapshots__/JsxComponent.js diff --git a/test/build.spec.ts b/test/build.spec.ts index d3d332e..c690f5a 100644 --- a/test/build.spec.ts +++ b/test/build.spec.ts @@ -38,7 +38,7 @@ describe('module builder', () => { expect(runtime).toMatchInlineSnapshot(` [ "plugin.d.ts", - "plugin.mjs", + "plugin.js", ] `) }) @@ -109,10 +109,10 @@ describe('module builder', () => { it('should handle JSX correctly', async () => { const [component, declaration] = await Promise.all([ - readFile(join(distDir, 'runtime/components/JsxComponent.mjs'), 'utf-8'), + readFile(join(distDir, 'runtime/components/JsxComponent.js'), 'utf-8'), readFile(join(distDir, 'runtime/components/JsxComponent.d.ts'), 'utf-8'), ]) - expect(component).toMatchFileSnapshot('__snapshots__/JsxComponent.mjs') + expect(component).toMatchFileSnapshot('__snapshots__/JsxComponent.js') expect(declaration).toMatchFileSnapshot('__snapshots__/JsxComponent.d.ts') }) })