You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
933 B

3 weeks ago
  1. /**
  2. * Introduces component library styles on demand.
  3. * https://github.com/antfu/unplugin-auto-import
  4. */
  5. import AutoImport from 'unplugin-auto-import/vite'
  6. export function configAutoImportPlugin() {
  7. return AutoImport({
  8. include: [
  9. /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
  10. /\.vue$/,
  11. /\.vue\?vue/, // .vue
  12. /\.md$/ // .md
  13. ],
  14. imports: ['vue', 'vue-router', '@vueuse/core'],
  15. // 可以选择auto-import.d.ts生成的位置,使用ts建议设置为'src/auto-import.d.ts'
  16. dts: 'src/auto-import.d.ts',
  17. // eslint globals Docs - https://eslint.org/docs/user-guide/configuring/language-options#specifying-globals
  18. // 生成全局声明文件,给eslint用
  19. eslintrc: {
  20. enabled: true, // Default `false`
  21. filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json`
  22. globalsPropValue: true // Default `true`, (true | false | 'readonly' | 'readable' | 'writable' | 'writeable')
  23. }
  24. })
  25. }