Skip to content

Commit

Permalink
修复 404
Browse files Browse the repository at this point in the history
  • Loading branch information
3DMXM committed Nov 6, 2024
1 parent 70846fb commit 22b733d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
9 changes: 0 additions & 9 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,11 @@ declare module 'vue' {
ElCard: typeof import('element-plus/es')['ElCard']
ElCollapse: typeof import('element-plus/es')['ElCollapse']
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElFooter: typeof import('element-plus/es')['ElFooter']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElMain: typeof import('element-plus/es')['ElMain']
ElOption: typeof import('element-plus/es')['ElOption']
ElSelect: typeof import('element-plus/es')['ElSelect']
Namespace: typeof import('./src/components/Namespace.vue')['default']
NativeDB: typeof import('./src/components/NativeDB.vue')['default']
NativeName: typeof import('./src/components/NativeName.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
export interface ComponentCustomProperties {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}
19 changes: 15 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

import { exec } from 'child_process'

// https://vite.dev/config/
export default defineConfig({
Expand All @@ -26,9 +26,20 @@ export default defineConfig({
},
build: {
rollupOptions: {
output: {
manualChunks: undefined
}
plugins: [
{
name: 'copy-index-to-404',
closeBundle() {
exec('cp dist/index.html dist/404.html', (err, stdout, stderr) => {
if (err) {
console.error(`Error copying index.html to 404.html: ${stderr}`);
} else {
console.log('index.html successfully copied to 404.html');
}
});
}
}
]
}
}
})

0 comments on commit 22b733d

Please # to comment.