Skip to content

Commit dbd05bb

Browse files
committed
fix!: use .js extension for files in runtime/ directory
1 parent afc4374 commit dbd05bb

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/commands/build.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export default defineCommand({
5454
{
5555
input: 'src/runtime/',
5656
outDir: `${outDir}/runtime`,
57-
ext: 'mjs',
57+
addRelativeDeclarationExtensions: true,
58+
ext: 'js',
5859
esbuild: {
5960
jsxImportSource: 'vue',
6061
jsx: 'automatic',

test/build.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('module builder', () => {
3838
expect(runtime).toMatchInlineSnapshot(`
3939
[
4040
"plugin.d.ts",
41-
"plugin.mjs",
41+
"plugin.js",
4242
]
4343
`)
4444
})
@@ -109,10 +109,10 @@ describe('module builder', () => {
109109

110110
it('should handle JSX correctly', async () => {
111111
const [component, declaration] = await Promise.all([
112-
readFile(join(distDir, 'runtime/components/JsxComponent.mjs'), 'utf-8'),
112+
readFile(join(distDir, 'runtime/components/JsxComponent.js'), 'utf-8'),
113113
readFile(join(distDir, 'runtime/components/JsxComponent.d.ts'), 'utf-8'),
114114
])
115-
expect(component).toMatchFileSnapshot('__snapshots__/JsxComponent.mjs')
115+
expect(component).toMatchFileSnapshot('__snapshots__/JsxComponent.js')
116116
expect(declaration).toMatchFileSnapshot('__snapshots__/JsxComponent.d.ts')
117117
})
118118
})

0 commit comments

Comments
 (0)