添加动态页功能
This commit is contained in:
@ -10,11 +10,18 @@ import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
|
||||
import { createHtmlPlugin } from 'vite-plugin-html'
|
||||
import viteCompression from 'vite-plugin-compression'
|
||||
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
// eslint-disable-next-line no-undef
|
||||
const env = loadEnv(mode, process.cwd())
|
||||
|
||||
// 生产环境复制 Amis 的 SDK,开发环境按需引用
|
||||
let copes = [{ src: 'node_modules/amis/sdk/*', dest: 'assets' }]
|
||||
if (mode === 'development')
|
||||
copes.push({ src: 'node_modules/amis/sdk/*', dest: 'node_modules/.vite/deps' })
|
||||
|
||||
return {
|
||||
base: './',
|
||||
build: {
|
||||
@ -70,6 +77,7 @@ export default defineConfig(({ mode }) => {
|
||||
},
|
||||
},
|
||||
}),
|
||||
viteStaticCopy({ targets: copes }),
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
|
Reference in New Issue
Block a user