chore: eslint 配置
This commit is contained in:
@ -3,7 +3,6 @@
|
||||
* https://github.com/vue-macros/vue-macros/blob/main/playground/vue3/vite.config.ts
|
||||
*/
|
||||
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
import VueI18n from '@intlify/unplugin-vue-i18n/vite';
|
||||
import { PrimeVueResolver } from '@primevue/auto-import-resolver';
|
||||
import { unheadVueComposablesImports } from '@unhead/vue';
|
||||
@ -26,6 +25,7 @@ import { createUtils4uAutoImports } from 'utils4u/auto-imports';
|
||||
import { PluginOption } from 'vite';
|
||||
import cdnImport from 'vite-plugin-cdn-import';
|
||||
import { vitePluginFakeServer } from 'vite-plugin-fake-server';
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
import VueDevTools from 'vite-plugin-vue-devtools';
|
||||
import Layouts from 'vite-plugin-vue-layouts';
|
||||
import MetaLayouts from 'vite-plugin-vue-meta-layouts';
|
||||
@ -42,22 +42,22 @@ export function Plugins() {
|
||||
plugins.push(
|
||||
VueMacros({
|
||||
plugins: {
|
||||
vue: Vue({ include: [/\.vue$/, /\.md$/] }),
|
||||
vueJsx: VueJsx(), // 如有需要
|
||||
// https://uvr.esm.is/guide/configuration.html
|
||||
// https://github.com/posva/unplugin-vue-router
|
||||
vueRouter: VueRouter({
|
||||
routesFolder: 'src/pages',
|
||||
exclude: ['**/__*', '**/__*/**/*'],
|
||||
extensions: ['.page.vue', '.page.md'],
|
||||
getRouteName: (routeNode) => getPascalCaseRouteName(routeNode),
|
||||
logs: false,
|
||||
extensions: ['.page.vue', '.page.md'],
|
||||
routesFolder: 'src/pages',
|
||||
}),
|
||||
vue: Vue({ include: [/\.vue$/, /\.md$/] }),
|
||||
vueJsx: VueJsx(), // 如有需要
|
||||
},
|
||||
}), // https://vue-macros.dev/zh-CN/guide/bundler-integration.html
|
||||
|
||||
// https://github.com/JohnCampionJr/vite-plugin-vue-layouts?tab=readme-ov-file#configuration
|
||||
Layouts({ pagesDirs: [], defaultLayout: 'sakai-vue/AppLayout' }),
|
||||
Layouts({ defaultLayout: 'sakai-vue/AppLayout', pagesDirs: [] }),
|
||||
|
||||
// https://github.com/dishait/vite-plugin-vue-meta-layouts
|
||||
MetaLayouts({
|
||||
@ -76,7 +76,11 @@ export function Plugins() {
|
||||
|
||||
// https://github.com/antfu/unplugin-auto-import
|
||||
AutoImport({
|
||||
resolvers: [TDesignResolver({ library: 'mobile-vue', esm: true }), VantResolver({ importStyle: true })],
|
||||
dirs: [
|
||||
// 'src/composables',
|
||||
'src/stores',
|
||||
'src/utils',
|
||||
],
|
||||
imports: [
|
||||
'vue',
|
||||
'vue-i18n',
|
||||
@ -95,37 +99,33 @@ export function Plugins() {
|
||||
},
|
||||
),
|
||||
{
|
||||
'consola/browser': ['consola'],
|
||||
// add any other imports you were relying on
|
||||
'vue-router/auto': ['useLink'],
|
||||
'consola/browser': ['consola'],
|
||||
},
|
||||
],
|
||||
dirs: [
|
||||
// 'src/composables',
|
||||
'src/stores',
|
||||
'src/utils',
|
||||
],
|
||||
resolvers: [TDesignResolver({ esm: true, library: 'mobile-vue' }), VantResolver({ importStyle: true })],
|
||||
vueTemplate: true,
|
||||
}),
|
||||
|
||||
// https://github.com/antfu/unplugin-vue-components
|
||||
Components({
|
||||
// __开头的
|
||||
excludeNames: [/^__/],
|
||||
// allow auto load markdown components under `./src/components/`
|
||||
extensions: ['vue', 'md'],
|
||||
// allow auto import and register components used in markdown
|
||||
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
|
||||
// __开头的
|
||||
excludeNames: [/^__/],
|
||||
resolvers: [
|
||||
AntDesignVueResolver({
|
||||
importStyle: false, // css in js
|
||||
resolveIcons: true,
|
||||
}),
|
||||
IconsResolver({
|
||||
prefix: 'icon',
|
||||
customCollections: ['svg'],
|
||||
prefix: 'icon',
|
||||
}), // https://github.com/unplugin/unplugin-icons?tab=readme-ov-file#auto-importing
|
||||
TDesignResolver({ library: 'mobile-vue', esm: true }),
|
||||
TDesignResolver({ esm: true, library: 'mobile-vue' }),
|
||||
VantResolver({ importStyle: true }),
|
||||
PrimeVueResolver(/* { components: { prefix: 'P' } } */),
|
||||
],
|
||||
@ -166,9 +166,9 @@ export function Plugins() {
|
||||
|
||||
// https://github.com/condorheroblog/vite-plugin-fake-server?tab=readme-ov-file#usage
|
||||
vitePluginFakeServer({
|
||||
include: 'fake',
|
||||
basename: 'fake-api',
|
||||
enableProd: true,
|
||||
include: 'fake',
|
||||
}),
|
||||
|
||||
viteStaticCopy({
|
||||
@ -195,9 +195,9 @@ export function Plugins() {
|
||||
// https://github.com/mmf-fe/vite-plugin-cdn-import/blob/HEAD/README.zh-CN.md
|
||||
// 会对 Components 插件的自动导入产生影响。
|
||||
cdnImport({
|
||||
enableInDevMode: true,
|
||||
modules: ['vue'],
|
||||
prodUrl: '//fastly.jsdelivr.net/npm/{name}@{version}/{path}',
|
||||
enableInDevMode: true,
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user