代码拉取完成,页面将自动刷新
同步操作将从 catchadmin/catchAdmin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import alias from '@rollup/plugin-alias'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { resolve } from 'path'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import Icons from 'unplugin-icons/vite'
const rootPath = resolve(__dirname)
import { createHtmlPlugin } from 'vite-plugin-html'
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd(), '')
return {
plugins: [
vue(),
vueJsx(),
createHtmlPlugin({
minify: true,
template: 'public/admin.html',
inject: {
data: {
title: env.APP_NAME,
},
},
}),
alias({
entries: [
{
find: '/admin',
replacement: resolve(rootPath, 'resources/admin'),
},
{
find: '@/module',
replacement: resolve(rootPath, 'modules'),
},
],
}),
AutoImport({
imports: ['vue', 'vue-router', 'pinia', '@vueuse/core'],
// resolvers: [ ElementPlusResolver({importStyle: 'sass'}) ]
}),
Components({
dirs: ['resources/admin/components/', 'resources/admin/layout/'],
extensions: ['vue'],
deep: true,
dts: true,
include: [/\.vue$/, /\.vue\?vue/],
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
// resolvers: [ ElementPlusResolver({ importStyle: 'sass'}) ]
}),
Icons({
compiler: 'vue3',
autoInstall: true,
}),
],
publicDir: './resources/admin/public',
define: {
BASE_URL: env.BASE_URL,
},
preprocessorOptions: {
scss: {
// additionalData: `@use "@/assets/styles/element.scss" as *;`,
},
},
server: {
host: '127.0.0.1',
port: 8000,
open: true, // 自动打开浏览器
cors: true, // 允许跨域
strictPort: false, // 端口占用直接退出
hmr: true,
fs: {
allow: ['./'],
},
},
build: {
chunkSizeWarningLimit: 2000,
minify: 'terser',
terserOptions: {
compress: {
drop_console: false,
pure_funcs: ['console.log', 'console.info'],
drop_debugger: true,
},
},
// emptyOutDir: false,
outDir: 'public/admin',
assetsDir: 'assets',
rollupOptions: {
input: './public/admin.html',
output: {
chunkFileNames: 'assets/js/[name]-[hash].js',
entryFileNames: 'assets/js/[name]-[hash].js',
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
},
},
},
}
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。