`<script setup lang="js">` compiles to a different result with `<script setup>`
Vue version
3.2.45
Link to minimal reproduction
https://stackblitz.com/edit/node-iqu5zb?file=index.js
Steps to reproduce
- Open stackblitz
npm i
(automatically runs)npm start
(automatically runs)
What is expected?
export default {
setup(__props, { expose }) {
expose();
const foo = 'foo';
const __returned__ = { foo }
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })
return __returned__
}
}
is output. (This output is the result without lang="js"
)
What is actually happening?
const foo = 'foo';
is output.
System Info
No response
Any additional comments?
I found this while digging around https://github.com/vitejs/vite-plugin-vue/issues/17.
If <template lang="html">
should work (https://github.com/vuejs/core/discussions/6929), I think <script setup lang="js">
should also work.