mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-04-05 04:22:49 +08:00
build(deps): add auto-import
This commit is contained in:
parent
2f7e871d3d
commit
86df69c037
1
.gitignore
vendored
1
.gitignore
vendored
@ -26,6 +26,7 @@ stats.html
|
|||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
/src/typings/components.d.ts
|
/src/typings/components.d.ts
|
||||||
|
/src/typings/auto-imports.d.ts
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
package-lock.json
|
package-lock.json
|
||||||
yarn.lock
|
yarn.lock
|
||||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2021 Soybean
|
Copyright (c) 2021 Rock chen
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import type { PluginOption } from 'vite'
|
import type { PluginOption } from 'vite'
|
||||||
import unocss from '@unocss/vite'
|
import UnoCSS from '@unocss/vite'
|
||||||
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
|
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
|
||||||
import vue from './vue'
|
import vue from './vue'
|
||||||
import compress from './compress'
|
import compress from './compress'
|
||||||
import visualizer from './visualizer'
|
import visualizer from './visualizer'
|
||||||
import unplugin from './unplugin'
|
import unplugin from './unplugin'
|
||||||
import mock from './mock'
|
import mock from './mock'
|
||||||
|
// import { viteMockServe } from 'vite-plugin-mock' // https://github.com/vbenjs/vite-plugin-mock/blob/main/README.zh_CN.md
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 设置vite插件配置
|
* @description: 设置vite插件配置
|
||||||
@ -13,7 +14,7 @@ import mock from './mock'
|
|||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
export function setVitePlugins(env: ImportMetaEnv) {
|
export function setVitePlugins(env: ImportMetaEnv) {
|
||||||
const plugins: PluginOption[] = [...vue, unocss(), ...unplugin, mock, vueSetupExtend()]
|
const plugins: PluginOption[] = [...vue, UnoCSS(), ...unplugin,mock, vueSetupExtend()]
|
||||||
// 是否压缩
|
// 是否压缩
|
||||||
if (env.VITE_COMPRESS_OPEN === 'Y')
|
if (env.VITE_COMPRESS_OPEN === 'Y')
|
||||||
plugins.push(compress(env))
|
plugins.push(compress(env))
|
||||||
|
@ -2,5 +2,6 @@ import { viteMockServe } from 'vite-plugin-mock' // https://github.com/vbenjs/vi
|
|||||||
|
|
||||||
export default viteMockServe({
|
export default viteMockServe({
|
||||||
mockPath: 'mock',
|
mockPath: 'mock',
|
||||||
injectCode: 'import { setupMockServer } from \'../mock\';setupMockServer();',
|
enable: true,
|
||||||
|
// watchFiles: false,
|
||||||
})
|
})
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import Components from 'unplugin-vue-components/vite'
|
||||||
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
|
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
|
||||||
|
|
||||||
import Icons from 'unplugin-icons/vite' // https://github.com/antfu/unplugin-icons
|
import Icons from 'unplugin-icons/vite' // https://github.com/antfu/unplugin-icons
|
||||||
@ -8,6 +9,15 @@ import IconsResolver from 'unplugin-icons/resolver'
|
|||||||
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' // https://github.com/vbenjs/vite-plugin-svg-icons/blob/main/README.zh_CN.md
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' // https://github.com/vbenjs/vite-plugin-svg-icons/blob/main/README.zh_CN.md
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
|
AutoImport({
|
||||||
|
imports: ['vue', 'vue-router','@vueuse/core','pinia'],
|
||||||
|
include: [
|
||||||
|
/\.[tj]sx?$/,
|
||||||
|
/\.vue$/,
|
||||||
|
/\.vue\?vue/,
|
||||||
|
/\.md$/],
|
||||||
|
dts: 'src/typings/auto-imports.d.ts',
|
||||||
|
}),
|
||||||
Components({
|
Components({
|
||||||
dts: 'src/typings/components.d.ts',
|
dts: 'src/typings/components.d.ts',
|
||||||
resolvers: [IconsResolver(), NaiveUiResolver()],
|
resolvers: [IconsResolver(), NaiveUiResolver()],
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import vueJsx from '@vitejs/plugin-vue-jsx' // https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx
|
import vueJsx from '@vitejs/plugin-vue-jsx' // https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx
|
||||||
|
import VueDevTools from 'vite-plugin-vue-devtools' // https://github.com/webfansplz/vite-plugin-vue-devtools
|
||||||
|
|
||||||
const plugins = [vue(), vueJsx()]
|
const plugins = [vue(), vueJsx(),VueDevTools()]
|
||||||
|
|
||||||
export default plugins
|
export default plugins
|
||||||
|
31
package.json
31
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ench-admin",
|
"name": "ench-admin",
|
||||||
"version": "0.0.1",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": {
|
"author": {
|
||||||
@ -57,28 +57,25 @@
|
|||||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"crypto-js": "^4.1.1",
|
"crypto-js": "^4.1.1",
|
||||||
"echarts": "^5.4.1",
|
"echarts": "^5.4.2",
|
||||||
"md-editor-v3": "^2.9.3",
|
"md-editor-v3": "^2.9.3",
|
||||||
"pinia": "^2.1.3",
|
"pinia": "^2.1.3",
|
||||||
"pinia-plugin-persist": "^1.0.0",
|
"pinia-plugin-persist": "^1.0.0",
|
||||||
"qs": "^6.11.1",
|
"qs": "^6.11.1",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.3.4",
|
||||||
"vue-qr": "^4.0.9",
|
"vue-qr": "^4.0.9",
|
||||||
"vue-router": "^4.1.6"
|
"vue-router": "^4.2.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@chansee97/commitlint-config": "^0.3.3",
|
"@chansee97/commitlint-config": "^0.3.3",
|
||||||
"@chansee97/eslint-config-vue": "^0.3.3",
|
"@chansee97/eslint-config-vue": "^0.3.3",
|
||||||
"@commitlint/cli": "^17.4.1",
|
"@commitlint/cli": "^17.6.5",
|
||||||
"@iconify-json/icon-park-outline": "^1.1.9",
|
"@iconify-json/icon-park-outline": "^1.1.11",
|
||||||
"@iconify/vue": "^4.0.2",
|
"@iconify/vue": "^4.1.1",
|
||||||
"@types/crypto-js": "^4.1.1",
|
"@types/crypto-js": "^4.1.1",
|
||||||
"@types/mockjs": "^1.0.7",
|
"@types/mockjs": "^1.0.7",
|
||||||
"@types/node": "^18.15.3",
|
"@types/node": "^20.3.1",
|
||||||
"@types/qs": "^6.9.7",
|
"@types/qs": "^6.9.7",
|
||||||
"@unocss/preset-attributify": "^0.50.4",
|
|
||||||
"@unocss/preset-uno": "^0.50.4",
|
|
||||||
"@unocss/vite": "^0.50.4",
|
|
||||||
"@vitejs/plugin-vue": "^4.0.0",
|
"@vitejs/plugin-vue": "^4.0.0",
|
||||||
"@vitejs/plugin-vue-jsx": "^3.0.0",
|
"@vitejs/plugin-vue-jsx": "^3.0.0",
|
||||||
"commitizen": "^4.2.6",
|
"commitizen": "^4.2.6",
|
||||||
@ -91,13 +88,16 @@
|
|||||||
"naive-ui": "^2.34.4",
|
"naive-ui": "^2.34.4",
|
||||||
"rollup-plugin-visualizer": "^5.9.0",
|
"rollup-plugin-visualizer": "^5.9.0",
|
||||||
"simple-git-hooks": "^2.8.1",
|
"simple-git-hooks": "^2.8.1",
|
||||||
"typescript": "^5.0.4",
|
"typescript": "^5.1.3",
|
||||||
"unplugin-icons": "^0.15.3",
|
"unocss": "^0.53.1",
|
||||||
"unplugin-vue-components": "^0.24.1",
|
"unplugin-auto-import": "^0.16.4",
|
||||||
"vite": "^4.3.8",
|
"unplugin-icons": "^0.16.3",
|
||||||
|
"unplugin-vue-components": "^0.25.1",
|
||||||
|
"vite": "^4.3.9",
|
||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-plugin-mock": "^2.9.6",
|
"vite-plugin-mock": "^2.9.6",
|
||||||
"vite-plugin-svg-icons": "^2.0.1",
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
|
"vite-plugin-vue-devtools": "^0.2.0",
|
||||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
"vite-plugin-vue-setup-extend": "^0.4.0",
|
||||||
"vue-tsc": "^1.6.5"
|
"vue-tsc": "^1.6.5"
|
||||||
},
|
},
|
||||||
@ -110,6 +110,7 @@
|
|||||||
"eslint --fix"
|
"eslint --fix"
|
||||||
],
|
],
|
||||||
"*.vue": [
|
"*.vue": [
|
||||||
"eslint --fix" ]
|
"eslint --fix"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,5 +19,3 @@ const themeOverrides: GlobalThemeOverrides = {} || themeConfig
|
|||||||
<naive-provider><router-view /></naive-provider>
|
<naive-provider><router-view /></naive-provider>
|
||||||
</n-config-provider>
|
</n-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import { defineConfig } from '@unocss/vite' // https://github.com/unocss/unocss
|
import { presetUno,presetAttributify,defineConfig } from 'unocss' // https://github.com/unocss/unocss
|
||||||
import presetUno from '@unocss/preset-uno'
|
|
||||||
import presetAttributify from '@unocss/preset-attributify'
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
presets: [presetUno({ dark: 'class' }), presetAttributify()],
|
presets: [presetUno({ dark: 'class' }), presetAttributify()],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user