1 Star 0 Fork 49

Oshigo/网易云音乐

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
沉默的熊 提交于 2024-04-02 20:31 . bugfixes & 错误日志记录
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import * as path from 'path';
import electron from 'vite-plugin-electron';
import electronRenderer from 'vite-plugin-electron/renderer';
import polyfillExports from 'vite-plugin-electron/polyfill-exports';
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import alias from "@rollup/plugin-alias";
import VueSetupExtend from 'vite-plugin-vue-setup-extend'
export default defineConfig({
server: {
port: 4005,
},
mode: 'development', // development | production
plugins: [
VueSetupExtend(),
vue(),
electron({
main: {
entry: 'electron/index.ts',
},
preload: {
// Must be use absolute path, this is the limit of rollup
input: path.join(__dirname, 'electron/preload.ts'),
},
}),
electronRenderer(),
polyfillExports(),
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
alias()
],
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
additionalData: `@import "${path.resolve(__dirname, 'src/assets/base.less')}";`
}
},
},
// 配置别名
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
build: {
emptyOutDir: false, // 必须配置,否则electron相关文件将不会生成build后的文件
commonjsOptions: {
transformMixedEsModules: true,
}
},
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/Oshigo/vue3-electron-netease-cloud.git
git@gitee.com:Oshigo/vue3-electron-netease-cloud.git
Oshigo
vue3-electron-netease-cloud
网易云音乐
master

搜索帮助