1 Star 0 Fork 135

tc310/escrcpy

forked from viarotel-org/escrcpy 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.js 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
viarotel 提交于 2024-09-12 19:11 . feat: ✨ Support floating control bar
import { resolve } from 'node:path'
import useI18n from '@intlify/unplugin-vue-i18n/vite'
import useVue from '@vitejs/plugin-vue'
import useUnoCSS from 'unocss/vite'
import { defineConfig, mergeConfig } from 'vite'
import { notBundle } from 'vite-plugin-electron/plugin'
import useElectron from 'vite-plugin-electron/simple'
import useRenderer from 'vite-plugin-electron-renderer'
import useSvg from 'vite-svg-loader'
import postcssConfig from './postcss.config.js'
import useAutoImports from './src/plugins/auto.js'
const alias = {
$: resolve('src'),
$root: resolve(),
$renderer: resolve('src'),
$electron: resolve('electron'),
$control: resolve('control'),
}
function mergeCommon(config, { command = '' } = {}) {
return mergeConfig(
{
resolve: {
alias,
},
plugins: [...(command === 'serve' ? [notBundle()] : [])],
},
config,
)
}
export default function (args) {
return mergeCommon(
defineConfig({
build: {
rollupOptions: {
input: {
main: resolve('index.html'),
control: resolve('control/index.html'),
},
},
},
plugins: [
useUnoCSS(),
useSvg(),
useVue(),
useI18n({
include: [resolve('src/locales/languages/**')],
}),
useElectron({
main: {
entry: 'electron/main.js',
vite: mergeCommon({}, args),
},
preload: {
input: 'electron/preload.js',
vite: mergeCommon({}, args),
},
}),
useRenderer(),
...useAutoImports(),
],
css: {
postcss: postcssConfig,
},
}),
)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tc310/escrcpy.git
git@gitee.com:tc310/escrcpy.git
tc310
escrcpy
escrcpy
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385