vite-plugin-dts 3.5.4 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/README.zh-CN.md +9 -1
- package/dist/index.cjs +9 -4
- package/dist/index.d.ts +8 -1
- package/dist/index.mjs +9 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ This is an existing [TypeScript issue](https://github.com/microsoft/TypeScript/i
|
|
|
90
90
|
|
|
91
91
|
```ts
|
|
92
92
|
import type ts from 'typescript'
|
|
93
|
-
import type { IExtractorConfigPrepareOptions } from '@microsoft/api-extractor'
|
|
93
|
+
import type { IExtractorConfigPrepareOptions, IExtractorInvokeOptions } from '@microsoft/api-extractor'
|
|
94
94
|
import type { LogLevel } from 'vite'
|
|
95
95
|
|
|
96
96
|
type MaybePromise<T> = T | Promise<T>
|
|
@@ -278,6 +278,14 @@ export interface PluginOptions {
|
|
|
278
278
|
*/
|
|
279
279
|
rollupConfig?: RollupConfig,
|
|
280
280
|
|
|
281
|
+
/**
|
|
282
|
+
* Override the invoke options of `@microsoft/api-extractor`
|
|
283
|
+
*
|
|
284
|
+
* @default null
|
|
285
|
+
* @see https://api-extractor.com/pages/setup/invoking/#invoking-from-a-build-script
|
|
286
|
+
*/
|
|
287
|
+
rollupOptions?: IExtractorInvokeOptions,
|
|
288
|
+
|
|
281
289
|
/**
|
|
282
290
|
* Whether to copy .d.ts source files to `outDir`
|
|
283
291
|
*
|
package/README.zh-CN.md
CHANGED
|
@@ -90,7 +90,7 @@ export default defineConfig({
|
|
|
90
90
|
|
|
91
91
|
```ts
|
|
92
92
|
import type ts from 'typescript'
|
|
93
|
-
import type { IExtractorConfigPrepareOptions } from '@microsoft/api-extractor'
|
|
93
|
+
import type { IExtractorConfigPrepareOptions, IExtractorInvokeOptions } from '@microsoft/api-extractor'
|
|
94
94
|
import type { LogLevel } from 'vite'
|
|
95
95
|
|
|
96
96
|
type MaybePromise<T> = T | Promise<T>
|
|
@@ -278,6 +278,14 @@ export interface PluginOptions {
|
|
|
278
278
|
*/
|
|
279
279
|
rollupConfig?: RollupConfig,
|
|
280
280
|
|
|
281
|
+
/**
|
|
282
|
+
* 覆写 `@microsoft/api-extractor` 的调用选项
|
|
283
|
+
*
|
|
284
|
+
* @default null
|
|
285
|
+
* @see https://api-extractor.com/pages/setup/invoking/#invoking-from-a-build-script
|
|
286
|
+
*/
|
|
287
|
+
rollupOptions?: IExtractorInvokeOptions,
|
|
288
|
+
|
|
281
289
|
/**
|
|
282
290
|
* 是否将源码里的 .d.ts 文件复制到 `outDir`
|
|
283
291
|
*
|
package/dist/index.cjs
CHANGED
|
@@ -195,7 +195,8 @@ function rollupDeclarationFiles({
|
|
|
195
195
|
entryPath,
|
|
196
196
|
fileName,
|
|
197
197
|
libFolder,
|
|
198
|
-
rollupConfig = {}
|
|
198
|
+
rollupConfig = {},
|
|
199
|
+
rollupOptions = {}
|
|
199
200
|
}) {
|
|
200
201
|
const configObjectFullPath = node_path.resolve(root, "api-extractor.json");
|
|
201
202
|
if (!dtsRE$1.test(fileName)) {
|
|
@@ -251,7 +252,8 @@ function rollupDeclarationFiles({
|
|
|
251
252
|
localBuild: false,
|
|
252
253
|
showVerboseMessages: false,
|
|
253
254
|
showDiagnostics: false,
|
|
254
|
-
typescriptCompilerFolder: libFolder ? node_path.resolve(libFolder) : void 0
|
|
255
|
+
typescriptCompilerFolder: libFolder ? node_path.resolve(libFolder) : void 0,
|
|
256
|
+
...rollupOptions
|
|
255
257
|
});
|
|
256
258
|
return result.succeeded;
|
|
257
259
|
}
|
|
@@ -480,6 +482,7 @@ function dtsPlugin(options = {}) {
|
|
|
480
482
|
rollupTypes = false,
|
|
481
483
|
pathsToAliases = true,
|
|
482
484
|
aliasesExclude = [],
|
|
485
|
+
rollupOptions = {},
|
|
483
486
|
copyDtsFiles = false,
|
|
484
487
|
declarationOnly = false,
|
|
485
488
|
strictOutput = true,
|
|
@@ -878,7 +881,8 @@ export default ${libName}
|
|
|
878
881
|
entryPath: path,
|
|
879
882
|
fileName: node_path.basename(path),
|
|
880
883
|
libFolder,
|
|
881
|
-
rollupConfig
|
|
884
|
+
rollupConfig,
|
|
885
|
+
rollupOptions
|
|
882
886
|
});
|
|
883
887
|
emittedFiles.delete(path);
|
|
884
888
|
rollupFiles.add(path);
|
|
@@ -892,7 +896,8 @@ export default ${libName}
|
|
|
892
896
|
entryPath: typesPath,
|
|
893
897
|
fileName: node_path.basename(typesPath),
|
|
894
898
|
libFolder,
|
|
895
|
-
rollupConfig
|
|
899
|
+
rollupConfig,
|
|
900
|
+
rollupOptions
|
|
896
901
|
});
|
|
897
902
|
emittedFiles.delete(typesPath);
|
|
898
903
|
rollupFiles.add(typesPath);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
import { LogLevel } from 'vite';
|
|
3
3
|
import ts from 'typescript';
|
|
4
|
-
import { IExtractorConfigPrepareOptions } from '@microsoft/api-extractor';
|
|
4
|
+
import { IExtractorInvokeOptions, IExtractorConfigPrepareOptions } from '@microsoft/api-extractor';
|
|
5
5
|
|
|
6
6
|
type MaybePromise<T> = T | Promise<T>;
|
|
7
7
|
type RollupConfig = Omit<IExtractorConfigPrepareOptions['configObject'], 'projectFolder' | 'mainEntryPointFilePath' | 'compiler' | 'dtsRollup'>;
|
|
@@ -164,6 +164,13 @@ interface PluginOptions {
|
|
|
164
164
|
* @see https://api-extractor.com/pages/setup/configure_api_report/
|
|
165
165
|
*/
|
|
166
166
|
rollupConfig?: RollupConfig;
|
|
167
|
+
/**
|
|
168
|
+
* Override the invoke options of `@microsoft/api-extractor`
|
|
169
|
+
*
|
|
170
|
+
* @default null
|
|
171
|
+
* @see https://api-extractor.com/pages/setup/invoking/#invoking-from-a-build-script
|
|
172
|
+
*/
|
|
173
|
+
rollupOptions?: IExtractorInvokeOptions;
|
|
167
174
|
/**
|
|
168
175
|
* Whether to copy .d.ts source files to `outDir`
|
|
169
176
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -195,7 +195,8 @@ function rollupDeclarationFiles({
|
|
|
195
195
|
entryPath,
|
|
196
196
|
fileName,
|
|
197
197
|
libFolder,
|
|
198
|
-
rollupConfig = {}
|
|
198
|
+
rollupConfig = {},
|
|
199
|
+
rollupOptions = {}
|
|
199
200
|
}) {
|
|
200
201
|
const configObjectFullPath = resolve$1(root, "api-extractor.json");
|
|
201
202
|
if (!dtsRE$1.test(fileName)) {
|
|
@@ -251,7 +252,8 @@ function rollupDeclarationFiles({
|
|
|
251
252
|
localBuild: false,
|
|
252
253
|
showVerboseMessages: false,
|
|
253
254
|
showDiagnostics: false,
|
|
254
|
-
typescriptCompilerFolder: libFolder ? resolve$1(libFolder) : void 0
|
|
255
|
+
typescriptCompilerFolder: libFolder ? resolve$1(libFolder) : void 0,
|
|
256
|
+
...rollupOptions
|
|
255
257
|
});
|
|
256
258
|
return result.succeeded;
|
|
257
259
|
}
|
|
@@ -480,6 +482,7 @@ function dtsPlugin(options = {}) {
|
|
|
480
482
|
rollupTypes = false,
|
|
481
483
|
pathsToAliases = true,
|
|
482
484
|
aliasesExclude = [],
|
|
485
|
+
rollupOptions = {},
|
|
483
486
|
copyDtsFiles = false,
|
|
484
487
|
declarationOnly = false,
|
|
485
488
|
strictOutput = true,
|
|
@@ -878,7 +881,8 @@ export default ${libName}
|
|
|
878
881
|
entryPath: path,
|
|
879
882
|
fileName: basename(path),
|
|
880
883
|
libFolder,
|
|
881
|
-
rollupConfig
|
|
884
|
+
rollupConfig,
|
|
885
|
+
rollupOptions
|
|
882
886
|
});
|
|
883
887
|
emittedFiles.delete(path);
|
|
884
888
|
rollupFiles.add(path);
|
|
@@ -892,7 +896,8 @@ export default ${libName}
|
|
|
892
896
|
entryPath: typesPath,
|
|
893
897
|
fileName: basename(typesPath),
|
|
894
898
|
libFolder,
|
|
895
|
-
rollupConfig
|
|
899
|
+
rollupConfig,
|
|
900
|
+
rollupOptions
|
|
896
901
|
});
|
|
897
902
|
emittedFiles.delete(typesPath);
|
|
898
903
|
rollupFiles.add(typesPath);
|