1 Star 0 Fork 3

x-github/SwitchHosts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.render.config.ts 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
oldj 提交于 2023-04-15 11:26 . Update dependencies.
import react from '@vitejs/plugin-react'
import * as path from 'path'
import { defineConfig } from 'vite'
import svgr from 'vite-plugin-svgr'
import tsconfigPaths from 'vite-tsconfig-paths'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
tsconfigPaths(),
svgr({
// Set it to `true` to export React component as default.
// Notice that it will overrides the default behavior of Vite.
exportAsDefault: true,
}),
react(),
],
base: './',
root: path.join(__dirname, 'src', 'renderer'),
build: {
rollupOptions: {
input: {
renderer: path.join(__dirname, 'src', 'renderer', 'index.html'),
},
},
outDir: path.join(__dirname, 'build'),
minify: true,
ssr: false,
emptyOutDir: false,
},
css: {
modules: {
generateScopedName: '[name]__[local]___[hash:base64:5]',
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@root': path.resolve(__dirname),
'@assets': path.resolve(__dirname, 'assets'),
'@src': path.resolve(__dirname, 'src'),
'@common': path.resolve(__dirname, 'src', 'common'),
'@main': path.resolve(__dirname, 'src', 'main'),
'@renderer': path.resolve(__dirname, 'src', 'renderer'),
'@styles': path.resolve(__dirname, 'src', 'renderer', 'styles'),
},
},
server: {
host: '127.0.0.1',
port: 8220,
},
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/x-github/SwitchHosts.git
[email protected]:x-github/SwitchHosts.git
x-github
SwitchHosts
SwitchHosts
master

搜索帮助