Skip to content

vixt / core / ImportsOptions

ImportsOptions

Extends

Properties

biomelintrc?

optional biomelintrc?: BiomeLintrc

Generate corresponding .biomelintrc.json file.

Inherited from

ExtractPluginOptions.biomelintrc


defaultExportByFilename?

optional defaultExportByFilename?: boolean

Set default export alias by file name

Default

ts
false

Inherited from

ExtractPluginOptions.defaultExportByFilename


dirs?

optional dirs?: (string | ScanDir)[]

Path for directories to be auto imported

Inherited from

ExtractPluginOptions.dirs


dirsScanOptions?

optional dirsScanOptions?: Omit<ScanDirExportsOptions, "cwd">

Options for scanning directories for auto import

Inherited from

ExtractPluginOptions.dirsScanOptions


dts?

optional dts?: string | boolean

Specifies the file path for generating the corresponding .d.ts file. This option is enabled by default when typescript is installed locally. Set to false to disable this feature.

Inherited from

ExtractPluginOptions.dts


dtsMode?

optional dtsMode?: "overwrite" | "append"

Mode for generating the .d.ts file.

  • overwrite: overwrite the whole existing .d.ts file with the new type definitions.
  • append: only append the new type definitions to the existing .d.ts file, means the existing type definitions will be kept.

Default

ts
'append'

Inherited from

ExtractPluginOptions.dtsMode


dtsPreserveExts?

optional dtsPreserveExts?: boolean

Preserve the original file extensions in the generated .d.ts file. Set to true to keep the extensions for .ts and .tsx files.

Default

ts
false

Inherited from

ExtractPluginOptions.dtsPreserveExts


dumpUnimportItems?

optional dumpUnimportItems?: string | boolean

Save unimport items into a JSON file for other tools to consume. Provide a filepath to save the JSON file.

When set to true, it will save to ./.unimport-items.json

Default

ts
false

Inherited from

ExtractPluginOptions.dumpUnimportItems


eslintrc?

optional eslintrc?: ESLintrc

Generate corresponding .eslintrc-auto-import.json file.

Inherited from

ExtractPluginOptions.eslintrc


exclude?

optional exclude?: FilterPattern

Rules to exclude transforming target.

Default

ts
[/[\/]node_modules[\/]/, /[\/]\.git[\/]/]

Inherited from

ExtractPluginOptions.exclude


ignore?

optional ignore?: (string | RegExp)[]

Identifiers to be ignored

Inherited from

ExtractPluginOptions.ignore


ignoreDts?

optional ignoreDts?: (string | RegExp)[]

These identifiers won't be put on the DTS file

Inherited from

ExtractPluginOptions.ignoreDts


imports?

optional imports?: Arrayable<"vitepress" | ImportsMap | "@vue/composition-api" | "pinia" | "vue-demi" | "vue-i18n" | "vue-router-composables" | "vue" | "vue/macros" | "vitest" | "rxjs" | "date-fns" | "ahooks" | "@vueuse/core" | "@vueuse/math" | "@vueuse/head" | "mobx" | "mobx-react-lite" | "preact" | "quasar" | "react" | "react-dom" | "react-router" | "react-router-dom" | "react-i18next" | "svelte" | "svelte/animate" | "svelte/easing" | "svelte/motion" | "svelte/store" | "svelte/transition" | "vee-validate" | "vue-router" | "vue-router/composables" | "vuex" | "uni-app" | "solid-js" | "@solidjs/router" | "solid-app-router" | "jotai" | "jotai/utils" | "recoil" | InlinePreset>

Preset names or custom imports map

Default

ts
[]

Inherited from

ExtractPluginOptions.imports


include?

optional include?: FilterPattern

Rules to include transforming target.

Default

ts
[/\.[jt]sx?$/, /\.astro$/, /\.vue$/, /\.vue\?vue/, /\.vue\.[tj]sx?\?vue/, /\.svelte$/]

Inherited from

ExtractPluginOptions.include


injectAtEnd?

optional injectAtEnd?: boolean

Inject the imports at the end of other imports

Default

ts
true

Inherited from

ExtractPluginOptions.injectAtEnd


packagePresets?

optional packagePresets?: (string | PackagePreset)[]

Local package presets.

Register local installed packages as a preset.

Default

ts
[]

See

https://github.com/unplugin/unplugin-auto-import#package-presets

Inherited from

ExtractPluginOptions.packagePresets


parser?

optional parser?: "acorn" | "regex"

Parser to be used for parsing the source code.

See

https://github.com/unjs/unimport#acorn-parser

Default

ts
'regex'

Inherited from

ExtractPluginOptions.parser


resolvers?

optional resolvers?: Arrayable<Arrayable<Resolver>>

Pass a custom function to resolve the component importing path from the component name.

The component names are always in PascalCase

Inherited from

ExtractPluginOptions.resolvers


viteOptimizeDeps?

optional viteOptimizeDeps?: boolean

Include auto-imported packages in Vite's optimizeDeps option

Default

ts
true

Inherited from

ExtractPluginOptions.viteOptimizeDeps


vueDirectives?

optional vueDirectives?: true | AddonVueDirectivesOptions

Enable auto import directives for Vue's SFC.

Library authors should include meta.vueDirective: true in the import metadata.

When using a local directives folder, provide the isDirective callback to check if the import is a Vue directive.

See

https://github.com/unjs/unimport?tab=readme-ov-file#vue-directives-auto-import-and-typescript-declaration-generation

Inherited from

ExtractPluginOptions.vueDirectives


vueTemplate?

optional vueTemplate?: boolean

Auto import inside Vue templates

See

Default

ts
false

Inherited from

ExtractPluginOptions.vueTemplate