代码拉取完成,页面将自动刷新
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import autoprefixer from 'autoprefixer'
import Unocss from 'unocss/vite'
import { presetUno, presetIcons, transformerDirectives } from 'unocss'
import presetAutoprefixer from 'unocss-preset-autoprefixer'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ArcoResolver } from 'unplugin-vue-components/resolvers'
import { visualizer } from 'rollup-plugin-visualizer'
import topLevelAwait from 'vite-plugin-top-level-await'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
export default defineConfig(async () => ({
plugins: [
vue(),
VueI18nPlugin({
include: ['./src/locales/**']
}),
Unocss({
presets: [presetUno(), presetIcons(), presetAutoprefixer()],
transformers: [
transformerDirectives({
applyVariable: ['--uno']
})
]
}),
AutoImport({
dts: './src/types/auto-import.d.ts',
eslintrc: {
enabled: true
},
imports: [
'vue',
'pinia',
'vue-i18n',
{
'@arco-design/web-vue': ['Message']
}
],
resolvers: [ArcoResolver()],
vueTemplate: true,
dirs: [
'./src/api/*',
'./src/constants/*',
'./src/hooks/*',
'./src/sqls/*',
'./src/stores/*',
'./src/utils/*'
]
}),
Components({
dts: './src/types/components.d.ts',
resolvers: [
ArcoResolver({
resolveIcons: true
})
]
}),
visualizer(),
topLevelAwait({
// The export name of top-level await promise for each chunk module
promiseExportName: '__tla',
// The function to generate import names of top-level await promise in each chunk module
promiseImportName: (i) => `__tla_${i}`
})
],
resolve: {
alias: {
'@': '/src'
}
},
clearScreen: false,
server: {
port: 1420,
strictPort: true,
host: '0.0.0.0'
},
envPrefix: ['VITE_', 'TAURI_'],
build: {
target: process.env.TAURI_PLATFORM == 'windows' ? 'chrome105' : 'safari13',
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
sourcemap: !!process.env.TAURI_DEBUG
},
css: {
postcss: {
plugins: [
autoprefixer({
overrideBrowserslist: [
'Android 4.1',
'iOS 7.1',
'Chrome > 31',
'ff > 31',
'ie >= 8',
'last 10 versions'
]
})
]
}
}
}))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。