-
Notifications
You must be signed in to change notification settings - Fork 556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Help] mysql2这个npm包无法被排除构建 #471
Labels
help wanted
Extra attention is needed
Comments
试试 electron-vite-vue/vite.config.ts Line 39 in af8aa6c
|
也试过了,mysql2就在dependencies里面,还是无效。 |
试了,但是TypeScript没通过,又撤回了。 plugins: [
command === 'serve' && notBundle(filters: id => id == 'mysql2'),
], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我是在主进程中使用的,引入代码是
import mysql from 'mysql2/promise'
。运行npm run dev
后,在dist-electron/main
文件夹下发现打包后的文件很大,根据排查发现是mysql2
这个包没法被排除构建,不能以import
的方式引入。然后我在
vite.config.ts
中设置,不管是defineConfig
下面的,还是electron plugin里面的vite
属性里面配置optimizeDeps.exclude: ['mysql2']
都无效。我引入的其他包,例如
jsonwebtoken
就没有问题,被排除在外了。The text was updated successfully, but these errors were encountered: