Description
Related plugins
Describe the bug
import { defineComponent } from 'vue';
const monacoEditorTemplateCode = 'export default defineComponent';
export default defineComponent({
setup() {
return () => monacoEditorTemplateCode;
},
});
monacoEditorTemplateCode
will be compiled to const __default__ = defineComponent
under the following conditions: has default export
、JSX
、HMR or SSR
Reproduction
https://stackblitz.com/edit/vitejs-vite-rgsvev?file=src%2FApp.tsx
Steps to reproduce
# Reproduces only in the development environment.
npm run dev
System Info
System:
OS: macOS 12.6
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 5.07 GB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.17.1/bin/yarn
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
pnpm: 7.15.0 - ~/Library/pnpm/pnpm
Watchman: 4.9.0 - /usr/local/bin/watchman
Browsers:
Edge: 121.0.2277.83
Safari: 16.0
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.