unplugin / unplugin-auto-import

Auto import APIs on-demand for Vite, Webpack and Rollup
MIT License
3.26k stars 199 forks source link

[bug]在electron-vite打包的时候报错Cannot find name 'reactive' #519

Open thinkiveWJ opened 2 months ago

thinkiveWJ commented 2 months ago

Describe the bug

在electron-vite开发环境下正常使用,但是打包的时候报错Cannot find name 'reactive'

Reproduction

https://codesandbox.io/p/devbox/cool-bassi-qk7hd7?file=%2Faaaa%2Felectron-app%2Fsrc%2Frenderer%2Fsrc%2FApp.vue%3A8%2C1

System Info

在electron-vite开发环境下正常使用,但是打包的时候报错Cannot find name 'reactive'

Used Package Manager

npm

Validations

thinkiveWJ commented 2 months ago

复现环境打包的时候报错Cannot find name 'ref'

thinkiveWJ commented 2 months ago

复现步骤: 1、cd aaaaa/electron-app 2、npm run build

thinkiveWJ commented 2 months ago

https://codesandbox.io/p/devbox/cool-bassi-qk7hd7?file=%2Faaaa%2Felectron-app%2Fsrc%2Frenderer%2Fsrc%2FApp.vue%3A8%2C1 这个案例无法在线运行; 可在本地运行,具体步骤: 1、npm create @quick-start/electron@latest

2、选vue框架,其他全部选择yes 3、pnpm install 4、pnpm install unplugin-auto-import 5、在app.vue内容修改为

<script setup lang="ts">
const num = ref(1)
</script>

<template>
  <div>{{ num }}</div>
</template>

6、配置unplugin-auto-import 7、可正常运行[npm run dev],但是不能正常打包[npm run build]