marmotte / vite/dts
vite/dts
Interfaces
PluginOptions
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:43
Properties
afterBuild?
optionalafterBuild?: (emittedFiles) =>MaybePromise<void>
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:237
Hook called after all declaration files are written.
It will be received a map (path -> content) that records those emitted files.
Parameters
emittedFiles
Map<string, string>
Returns
MaybePromise<void>
Default
() => {}afterDiagnostic?
optionalafterDiagnostic?: (diagnostics) =>MaybePromise<void>
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:210
Hook called after diagnostic is emitted.
According to the diagnostics.length, you can judge whether there is any type error.
Parameters
diagnostics
readonly Diagnostic[]
Returns
MaybePromise<void>
Default
() => {}afterRollup?
optionalafterRollup?: (result) =>MaybePromise<void>
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:229
Hook called after rolling up declaration files.
Parameters
result
ExtractorResult
Returns
MaybePromise<void>
Default
() => {}aliasesExclude?
optionalaliasesExclude?: (string|RegExp)[]
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:108
Set which paths should be excluded when transforming aliases.
Default
[]beforeWriteFile?
optionalbeforeWriteFile?: (filePath,content) =>MaybePromise<false|void| {content?:string;filePath?:string; }>
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:220
Hook called prior to writing each declaration file.
This allows you to transform the path or content.
The file will be skipped when the return value false or Promise<false>.
Parameters
filePath
string
content
string
Returns
MaybePromise<false | void | { content?: string; filePath?: string; }>
Default
() => {}bundledPackages?
optionalbundledPackages?:string[]
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:167
Bundled packages for @microsoft/api-extractor.
Default
[]See
https://api-extractor.com/pages/configs/api-extractor_json/#bundledpackages
cleanVueFileName?
optionalcleanVueFileName?:boolean
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:116
Whether to transform file names ending in '.vue.d.ts' to '.d.ts'.
If there is a duplicate name after transform, it will fall back to the original name.
Default
falseclearPureImport?
optionalclearPureImport?:boolean
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:142
Whether to remove import 'xxx'.
Default
truecompilerOptions?
optionalcompilerOptions?:CompilerOptions|null
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:79
Override compilerOptions.
Default
nullcopyDtsFiles?
optionalcopyDtsFiles?:boolean
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:188
Whether to copy .d.ts source files to outDir.
Default
falseRemarks
Before 2.0, the default was true.
declarationOnly?
optionaldeclarationOnly?:boolean
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:196
Whether to emit declaration files only.
When true, all the original outputs of vite (rollup) will be force removed.
Default
falseentryRoot?
optionalentryRoot?:string
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:65
Override root path of entry files (useful in monorepos).
The output path of each file will be calculated based on the value provided.
The default is the smallest public path for all source files.
exclude?
optionalexclude?:string|string[]
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:136
Override exclude glob.
Defaults to exclude property of tsconfig.json or 'node_modules/**' if not supplied.
include?
optionalinclude?:string|string[]
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:130
Override include glob (relative to root).
Defaults to include property of tsconfig.json (relative to tsconfig.json located).
insertTypesEntry?
optionalinsertTypesEntry?:boolean
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:152
Whether to generate types entry file(s).
When true, uses package.json types property if it exists or ${outDir}/index.d.ts.
Value is forced to true when rollupTypes is true.
Default
falselogLevel?
optionallogLevel?:LogLevel
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:202
Logging level for this plugin.
Defaults to the 'logLevel' property of your Vite config.
outDir?
optionaloutDir?:string|string[]
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:57
Output directory for declaration files.
Can be an array to output to multiple directories.
Defaults to 'build.outDir' of the Vite config, or outDir of tsconfig.json if using Rollup.
pathsToAliases?
optionalpathsToAliases?:boolean
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:102
Parsing paths of tsconfig.json to aliases.
Note that these aliases only use for declaration files.
Default
trueRemarks
Only use first replacement of each path.
resolvers?
optionalresolvers?:Resolver[]
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:93
Specify custom resolvers.
Default
[]rollupConfig?
optionalrollupConfig?:RollupConfig
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:174
Override the config of @microsoft/api-extractor.
Default
nullSee
https://api-extractor.com/pages/setup/configure_api_report/
rollupOptions?
optionalrollupOptions?:IExtractorInvokeOptions
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:181
Override the invoke options of @microsoft/api-extractor.
Default
nullSee
https://api-extractor.com/pages/setup/invoking/#invoking-from-a-build-script
rollupTypes?
optionalrollupTypes?:boolean
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:160
Rollup type declaration files after emitting them.
Powered by @microsoft/api-extractor - time-intensive operation.
Default
falseroot?
optionalroot?:string
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:49
Specify root directory.
Defaults to the 'root' of the Vite config, or process.cwd() if using Rollup.
staticImport?
optionalstaticImport?:boolean
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:124
Whether to transform dynamic imports to static (eg import('vue').DefineComponent to import { DefineComponent } from 'vue').
Value is forced to true when rollupTypes is true.
Default
falsestrictOutput?
optionalstrictOutput?:boolean
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:73
Restrict declaration files output to outDir.
If true, generated declaration files outside outDir will be ignored.
Default
truetsconfigPath?
optionaltsconfigPath?:string
Defined in: node_modules/vite-plugin-dts/dist/index.d.ts:87
Specify tsconfig.json path.
Plugin resolves include and exclude globs from tsconfig.json.
If not specified, plugin will find config file from root.
Functions
default()
default(
options?):Plugin<{options:PluginOptions; }>
Defined in: src/vite/dts.ts:14
A wrapper around vite-plugin-dts that also exposes the options so that other plugins can use the same TS config without having to copy paste settings
Parameters
options?
PluginOptions = {}
Returns
Plugin<{ options: PluginOptions; }>
getDTSPlugin()
getDTSPlugin(
config):Plugin<{options:PluginOptions; }>[]
Defined in: src/vite/dts.ts:26
Parameters
config
ResolvedConfig
Returns
Plugin<{ options: PluginOptions; }>[]
getDTSPluginOptions()
getDTSPluginOptions(
config):PluginOptions
Defined in: src/vite/dts.ts:30
Parameters
config
ResolvedConfig