node config problem fixd

This commit is contained in:
ray_wuhao 2023-01-09 17:51:37 +08:00
parent 914fcb07ff
commit 012c135e19
3 changed files with 9 additions and 2 deletions

5
src/vite-env.d.ts vendored
View File

@ -22,3 +22,8 @@ declare module 'virtual:*' {
const result: any const result: any
export default result export default result
} }
declare module '*.json' {
const jsonContent: any
export default jsonContent
}

View File

@ -3,6 +3,7 @@
"composite": true, "composite": true,
"module": "ESNext", "module": "ESNext",
"moduleResolution": "Node", "moduleResolution": "Node",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true "allowSyntheticDefaultImports": true
}, },
"include": [ "include": [
@ -10,6 +11,7 @@
"vite-plugin/index.ts", "vite-plugin/index.ts",
"vite-plugin/type.ts", "vite-plugin/type.ts",
"cfg.ts", "cfg.ts",
"src/types/cfg.ts" "src/types/cfg.ts",
"package.json"
] ]
} }

View File

@ -20,7 +20,7 @@ import viteCompression from 'vite-plugin-compression' // 压缩打包
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers' // 模板自动导入组件并且按需打包 import { NaiveUiResolver } from 'unplugin-vue-components/resolvers' // 模板自动导入组件并且按需打包
import config from './cfg' import config from './cfg'
const pkg = require('./package.json') import pkg from './package.json'
const { dependencies, devDependencies, name, version } = pkg const { dependencies, devDependencies, name, version } = pkg
const { server, buildOptions, alias, title, copyright, sideBarLogo } = config const { server, buildOptions, alias, title, copyright, sideBarLogo } = config