unplugin-dts-bundle-generator 3.0.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/.vscode/extensions.json +6 -0
- package/.vscode/settings.json +10 -0
- package/LICENCE +21 -0
- package/README.md +59 -0
- package/dist/dts-bundle-generator.cjs +2 -0
- package/dist/dts-bundle-generator.cjs.map +1 -0
- package/dist/dts-bundle-generator.d.ts +15 -0
- package/dist/dts-bundle-generator.mjs +7 -0
- package/dist/dts-bundle-generator.mjs.map +1 -0
- package/dist/factory-D34KlQ_a.js +57 -0
- package/dist/factory-D34KlQ_a.js.map +1 -0
- package/dist/factory-v7XFnpMY.cjs +3 -0
- package/dist/factory-v7XFnpMY.cjs.map +1 -0
- package/dist/vite.cjs +2 -0
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.d.ts +15 -0
- package/dist/vite.mjs +7 -0
- package/dist/vite.mjs.map +1 -0
- package/package.json +95 -0
package/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) François Lavaud-Wernert <https://github.com/f-lawe>.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# DTS Bundle Generator Unplugin
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/unplugin-dts-bundle-generator?activeTab=versions)
|
|
4
|
+
[](https://www.npmjs.com/package/unplugin-dts-bundle-generator)
|
|
5
|
+
[](./LICENCE)
|
|
6
|
+
[](https://github.com/f-lawe/unplugin-dts-bundle-generator/actions/workflows/pr-checks.yml)
|
|
7
|
+
|
|
8
|
+
Ever wanted to easily package your typescript library with a bundled declaration file? Integrate [DTS Bundle Generator](https://github.com/timocov/dts-bundle-generator) within [Vite](https://github.com/vitejs/vite) or any other blundler supported by [Unplugin](https://github.com/unjs/unplugin)! (see disclaimer below)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
```sh
|
|
12
|
+
npm i --save-dev unplugin-dts-bundle-generator
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
yarn add --dev unplugin-dts-bundle-generator
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
With Vite, add this block to your `vite.config.ts`:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import path from 'node:path';
|
|
24
|
+
import dtsBundleGenerator from 'unplugin-dts-bundle-generator/vite';
|
|
25
|
+
import { defineConfig, normalizePath } from 'vite';
|
|
26
|
+
|
|
27
|
+
export default defineConfig({
|
|
28
|
+
plugins: [
|
|
29
|
+
dtsBundleGenerator({
|
|
30
|
+
fileName: 'my-lib.d.ts',
|
|
31
|
+
output: {
|
|
32
|
+
// output config
|
|
33
|
+
},
|
|
34
|
+
libraries: {
|
|
35
|
+
// libraries config
|
|
36
|
+
},
|
|
37
|
+
compilation: {
|
|
38
|
+
// compilation options
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
],
|
|
42
|
+
build: {
|
|
43
|
+
lib: {
|
|
44
|
+
entry: normalizePath(path.resolve('src', 'index.ts')),
|
|
45
|
+
formats: ['es'],
|
|
46
|
+
fileName: 'my-lib.js'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
And that's it!
|
|
53
|
+
|
|
54
|
+
## Configuration
|
|
55
|
+
|
|
56
|
+
This library handle both single and multiple entrypoints. You can use any of the output, libraries and compilation options available in the [config file](https://github.com/timocov/dts-bundle-generator/blob/master/src/config-file/README.md) of DTS Bundle Generator.
|
|
57
|
+
|
|
58
|
+
## Disclaimer
|
|
59
|
+
As this package is originally a Vite plugin, that's the only available export and supported bundler. Please open a PR or an issue if you need another export, so we can work it out.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dts-bundle-generator.cjs","sources":["../src/index.ts"],"sourcesContent":["import { createUnplugin } from 'unplugin';\n\nimport { unpluginFactory } from './core';\n\nexport default createUnplugin(unpluginFactory);\n"],"names":["index","createUnplugin","unpluginFactory"],"mappings":"6EAIAA,EAAeC,EAAAA,eAAeC,EAAAA,eAAe"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CompilationOptions, EntryPointConfig } from 'dts-bundle-generator';
|
|
2
|
+
|
|
3
|
+
export interface Options {
|
|
4
|
+
fileName: string | ((entryName: string) => string);
|
|
5
|
+
output?: EntryPointConfig["output"];
|
|
6
|
+
libraries?: EntryPointConfig["libraries"];
|
|
7
|
+
compilation?: CompilationOptions;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import("unplugin").UnpluginInstance<Options, false>;
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
_default as default,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dts-bundle-generator.mjs","sources":["../src/index.ts"],"sourcesContent":["import { createUnplugin } from 'unplugin';\n\nimport { unpluginFactory } from './core';\n\nexport default createUnplugin(unpluginFactory);\n"],"names":["index","createUnplugin","unpluginFactory"],"mappings":";;AAIA,MAAAA,IAAeC,EAAeC,CAAe;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Buffer as c } from "node:buffer";
|
|
2
|
+
import f from "node:fs";
|
|
3
|
+
import a from "node:path";
|
|
4
|
+
import u from "node:zlib";
|
|
5
|
+
import { generateDtsBundle as g } from "dts-bundle-generator";
|
|
6
|
+
import s from "picocolors";
|
|
7
|
+
const d = (e, i) => {
|
|
8
|
+
typeof i == "string" ? Object.assign(e, {
|
|
9
|
+
default: i
|
|
10
|
+
}) : Array.isArray(i) ? i.forEach((o) => {
|
|
11
|
+
Object.assign(e, {
|
|
12
|
+
[a.basename(o, a.extname(o))]: o
|
|
13
|
+
});
|
|
14
|
+
}) : Object.assign(e, i);
|
|
15
|
+
}, F = (e) => {
|
|
16
|
+
const i = [], o = {}, l = {}, m = typeof e.fileName == "function" ? e.fileName : () => e.fileName;
|
|
17
|
+
return {
|
|
18
|
+
name: "unplugin-dts-bundle-generator",
|
|
19
|
+
buildEnd() {
|
|
20
|
+
const t = Object.values(o).map((r) => ({
|
|
21
|
+
filePath: r,
|
|
22
|
+
libraries: e.libraries,
|
|
23
|
+
output: e.output
|
|
24
|
+
}));
|
|
25
|
+
g(t, e.compilation).forEach((r, n) => i.push({
|
|
26
|
+
compressedSize: u.gzipSync(r).length,
|
|
27
|
+
content: r,
|
|
28
|
+
outFile: m(Object.keys(o)[n]),
|
|
29
|
+
size: c.byteLength(r)
|
|
30
|
+
}));
|
|
31
|
+
},
|
|
32
|
+
writeBundle() {
|
|
33
|
+
i.forEach((t) => f.writeFileSync(a.resolve(l.outDir, t.outFile), t.content));
|
|
34
|
+
},
|
|
35
|
+
vite: {
|
|
36
|
+
configResolved(t) {
|
|
37
|
+
t.build.lib && d(o, t.build.lib.entry), l.outDir = t.build.outDir;
|
|
38
|
+
},
|
|
39
|
+
closeBundle() {
|
|
40
|
+
const t = i.length.toString();
|
|
41
|
+
this.environment.logger.info(`
|
|
42
|
+
${s.green("✓")} ${t} declaration bundles generated.`);
|
|
43
|
+
const r = {
|
|
44
|
+
maximumFractionDigits: 2,
|
|
45
|
+
minimumFractionDigits: 2
|
|
46
|
+
};
|
|
47
|
+
i.forEach((n) => this.environment.logger.info(
|
|
48
|
+
s.dim(`${l.outDir}/`) + s.cyan(`${n.outFile} `) + s.dim(`${(n.size / 1e3).toLocaleString("en", r)} kB │ `) + s.dim(`gzip: ${(n.compressedSize / 1e3).toLocaleString("en", r)} kB`)
|
|
49
|
+
));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
F as u
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=factory-D34KlQ_a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory-D34KlQ_a.js","sources":["../src/core/factory.ts"],"sourcesContent":["import type { CompilationOptions, EntryPointConfig } from 'dts-bundle-generator';\nimport type { InputOption } from 'rollup';\nimport type { UnpluginFactory } from 'unplugin';\n\nimport { Buffer } from 'node:buffer';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport zlib from 'node:zlib';\n\nimport { generateDtsBundle } from 'dts-bundle-generator';\nimport colors from 'picocolors';\n\nexport interface Options {\n fileName: string | ((entryName: string) => string);\n output?: EntryPointConfig['output'];\n libraries?: EntryPointConfig['libraries'];\n compilation?: CompilationOptions;\n}\n\ninterface DeclarationBundle {\n compressedSize: number;\n content: string;\n outFile: string;\n size: number;\n}\n\ninterface BuildConfig {\n outDir: string;\n}\n\nconst assignEntry = (entry: Record<string, string>, input: InputOption): void => {\n if (typeof input == 'string') {\n Object.assign(entry, {\n default: input,\n });\n }\n else if (Array.isArray(input)) {\n input.forEach((i) => {\n Object.assign(entry, {\n [path.basename(i, path.extname(i))]: i,\n });\n });\n }\n else {\n Object.assign(entry, input);\n }\n};\n\nexport const unpluginFactory: UnpluginFactory<Options, false> = (options) => {\n const bundles: Array<DeclarationBundle> = [];\n const entry: Record<string, string> = {};\n const buildConfig: BuildConfig = {} as BuildConfig;\n\n const fileName = typeof options.fileName == 'function'\n ? options.fileName\n : () => options.fileName as string;\n\n return {\n name: 'unplugin-dts-bundle-generator',\n buildEnd() {\n const entryPointConfigs: Array<EntryPointConfig> = Object.values(entry).map((entryPath) => ({\n filePath: entryPath,\n libraries: options.libraries,\n output: options.output,\n }));\n\n generateDtsBundle(entryPointConfigs, options.compilation).forEach((content, i) => bundles.push({\n compressedSize: zlib.gzipSync(content).length,\n content,\n outFile: fileName(Object.keys(entry)[i]),\n size: Buffer.byteLength(content),\n }));\n },\n writeBundle() {\n bundles.forEach((bundle) => fs.writeFileSync(path.resolve(buildConfig.outDir, bundle.outFile), bundle.content));\n },\n vite: {\n configResolved(config) {\n if (config.build.lib) {\n assignEntry(entry, config.build.lib.entry);\n }\n\n buildConfig.outDir = config.build.outDir;\n },\n closeBundle() {\n const length = bundles.length.toString();\n this.environment.logger.info(`\\n${colors.green('✓')} ${length} declaration bundles generated.`);\n\n const options = {\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n };\n\n bundles.forEach((bundle) => this.environment.logger.info(\n colors.dim(`${buildConfig.outDir}/`)\n + colors.cyan(`${bundle.outFile} `)\n + colors.dim(`${(bundle.size / 1000).toLocaleString('en', options)} kB │ `)\n + colors.dim(`gzip: ${(bundle.compressedSize / 1000).toLocaleString('en', options)} kB`),\n ));\n },\n },\n };\n};\n"],"names":["assignEntry","entry","input","i","path","unpluginFactory","options","bundles","buildConfig","fileName","entryP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IAAA;AAAA,IAEhH,MAAM;AAAA,MACJ,eAAeE,GAAQ;AACrB,QAAIA,EAAO,MAAM,OACflB,EAAYC,GAAOiB,EAAO,MAAM,IAAI,KAAK,GAG3CV,EAAY,SAASU,EAAO,MAAM;AAAA,MAAA;AAAA,MAEpC,cAAc;AACZ,cAAMC,IAASZ,EAAQ,OAAO,SAAA;AAC9B,aAAK,YAAY,OAAO,KAAK;AAAA,EAAKa,EAAO,MAAM,GAAG,CAAC,IAAID,CAAM,iCAAiC;AAE9F,cAAMb,IAAU;AAAA,UACd,uBAAuB;AAAA,UACvB,uBAAuB;AAAA,QAAA;AAGzB,QAAAC,EAAQ,QAAQ,CAACS,MAAW,KAAK,YAAY,OAAO;AAAA,UAClDI,EAAO,IAAI,GAAGZ,EAAY,MAAM,GAAG,IACjCY,EAAO,KAAK,GAAGJ,EAAO,OAAO,IAAI,IACjCI,EAAO,IAAI,IAAIJ,EAAO,OAAO,KAAM,eAAe,MAAMV,CAAO,CAAC,SAAS,IACzEc,EAAO,IAAI,UAAUJ,EAAO,iBAAiB,KAAM,eAAe,MAAMV,CAAO,CAAC,KAAK;AAAA,QAAA,CACxF;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAEJ;"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";const u=require("node:buffer"),g=require("node:fs"),a=require("node:path"),f=require("node:zlib"),d=require("dts-bundle-generator"),s=require("picocolors"),m=(e,i)=>{typeof i=="string"?Object.assign(e,{default:i}):Array.isArray(i)?i.forEach(r=>{Object.assign(e,{[a.basename(r,a.extname(r))]:r})}):Object.assign(e,i)},b=e=>{const i=[],r={},l={},c=typeof e.fileName=="function"?e.fileName:()=>e.fileName;return{name:"unplugin-dts-bundle-generator",buildEnd(){const t=Object.values(r).map(n=>({filePath:n,libraries:e.libraries,output:e.output}));d.generateDtsBundle(t,e.compilation).forEach((n,o)=>i.push({compressedSize:f.gzipSync(n).length,content:n,outFile:c(Object.keys(r)[o]),size:u.Buffer.byteLength(n)}))},writeBundle(){i.forEach(t=>g.writeFileSync(a.resolve(l.outDir,t.outFile),t.content))},vite:{configResolved(t){t.build.lib&&m(r,t.build.lib.entry),l.outDir=t.build.outDir},closeBundle(){const t=i.length.toString();this.environment.logger.info(`
|
|
2
|
+
${s.green("✓")} ${t} declaration bundles generated.`);const n={maximumFractionDigits:2,minimumFractionDigits:2};i.forEach(o=>this.environment.logger.info(s.dim(`${l.outDir}/`)+s.cyan(`${o.outFile} `)+s.dim(`${(o.size/1e3).toLocaleString("en",n)} kB │ `)+s.dim(`gzip: ${(o.compressedSize/1e3).toLocaleString("en",n)} kB`)))}}}};exports.unpluginFactory=b;
|
|
3
|
+
//# sourceMappingURL=factory-v7XFnpMY.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory-v7XFnpMY.cjs","sources":["../src/core/factory.ts"],"sourcesContent":["import type { CompilationOptions, EntryPointConfig } from 'dts-bundle-generator';\nimport type { InputOption } from 'rollup';\nimport type { UnpluginFactory } from 'unplugin';\n\nimport { Buffer } from 'node:buffer';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport zlib from 'node:zlib';\n\nimport { generateDtsBundle } from 'dts-bundle-generator';\nimport colors from 'picocolors';\n\nexport interface Options {\n fileName: string | ((entryName: string) => string);\n output?: EntryPointConfig['output'];\n libraries?: EntryPointConfig['libraries'];\n compilation?: CompilationOptions;\n}\n\ninterface DeclarationBundle {\n compressedSize: number;\n content: string;\n outFile: string;\n size: number;\n}\n\ninterface BuildConfig {\n outDir: string;\n}\n\nconst assignEntry = (entry: Record<string, string>, input: InputOption): void => {\n if (typeof input == 'string') {\n Object.assign(entry, {\n default: input,\n });\n }\n else if (Array.isArray(input)) {\n input.forEach((i) => {\n Object.assign(entry, {\n [path.basename(i, path.extname(i))]: i,\n });\n });\n }\n else {\n Object.assign(entry, input);\n }\n};\n\nexport const unpluginFactory: UnpluginFactory<Options, false> = (options) => {\n const bundles: Array<DeclarationBundle> = [];\n const entry: Record<string, string> = {};\n const buildConfig: BuildConfig = {} as BuildConfig;\n\n const fileName = typeof options.fileName == 'function'\n ? options.fileName\n : () => options.fileName as string;\n\n return {\n name: 'unplugin-dts-bundle-generator',\n buildEnd() {\n const entryPointConfigs: Array<EntryPointConfig> = Object.values(entry).map((entryPath) => ({\n filePath: entryPath,\n libraries: options.libraries,\n output: options.output,\n }));\n\n generateDtsBundle(entryPointConfigs, options.compilation).forEach((content, i) => bundles.push({\n compressedSize: zlib.gzipSync(content).length,\n content,\n outFile: fileName(Object.keys(entry)[i]),\n size: Buffer.byteLength(content),\n }));\n },\n writeBundle() {\n bundles.forEach((bundle) => fs.writeFileSync(path.resolve(buildConfig.outDir, bundle.outFile), bundle.content));\n },\n vite: {\n configResolved(config) {\n if (config.build.lib) {\n assignEntry(entry, config.build.lib.entry);\n }\n\n buildConfig.outDir = config.build.outDir;\n },\n closeBundle() {\n const length = bundles.length.toString();\n this.environment.logger.info(`\\n${colors.green('✓')} ${length} declaration bundles generated.`);\n\n const options = {\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n };\n\n bundles.forEach((bundle) => this.environment.logger.info(\n colors.dim(`${buildConfig.outDir}/`)\n + colors.cyan(`${bundle.outFile} `)\n + colors.dim(`${(bundle.size / 1000).toLocaleString('en', options)} kB │ `)\n + colors.dim(`gzip: ${(bundle.compressedSize / 1000).toLocaleString('en', options)} kB`),\n ));\n },\n },\n };\n};\n"],"names":["assignEntry","entry","input","i","path","unpluginFactory","options","bundles","buildConfig","fileName","entryPointConfigs","entryPath","generateDtsBundle","content","zlib","Buffer","bundle","fs","config","length","colors"],"mappings":"yKA8BMA,EAAc,CAACC,EAA+BC,IAA6B,CAC3E,OAAOA,GAAS,SAClB,OAAO,OAAOD,EAAO,CACnB,QAASC,CAAA,CACV,EAEM,MAAM,QAAQA,CAAK,EAC1BA,EAAM,QAASC,GAAM,CACnB,OAAO,OAAOF,EAAO,CACnB,CAACG,EAAK,SAASD,EAAGC,E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EAAO,KAAK,GAAGJ,EAAO,OAAO,IAAI,EACjCI,EAAO,IAAI,IAAIJ,EAAO,KAAO,KAAM,eAAe,KAAMV,CAAO,CAAC,SAAS,EACzEc,EAAO,IAAI,UAAUJ,EAAO,eAAiB,KAAM,eAAe,KAAMV,CAAO,CAAC,KAAK,CAAA,CACxF,CAAA,CACH,CACF,CAEJ"}
|
package/dist/vite.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.cjs","sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from 'unplugin';\nimport { unpluginFactory } from './core';\n\nexport default createVitePlugin(unpluginFactory);\n"],"names":["vite","createVitePlugin","unpluginFactory"],"mappings":"6EAGAA,EAAeC,EAAAA,iBAAiBC,EAAAA,eAAe"}
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CompilationOptions, EntryPointConfig } from 'dts-bundle-generator';
|
|
2
|
+
|
|
3
|
+
export interface Options {
|
|
4
|
+
fileName: string | ((entryName: string) => string);
|
|
5
|
+
output?: EntryPointConfig["output"];
|
|
6
|
+
libraries?: EntryPointConfig["libraries"];
|
|
7
|
+
compilation?: CompilationOptions;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: (options: Options) => import("vite").Plugin<any> | import("vite").Plugin<any>[];
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
_default as default,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export {};
|
package/dist/vite.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.mjs","sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from 'unplugin';\nimport { unpluginFactory } from './core';\n\nexport default createVitePlugin(unpluginFactory);\n"],"names":["vite","createVitePlugin","unpluginFactory"],"mappings":";;AAGA,MAAAA,IAAeC,EAAiBC,CAAe;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "unplugin-dts-bundle-generator",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "DTS bundle generator for Unplugin",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"unplugin",
|
|
7
|
+
"vite",
|
|
8
|
+
"webpack",
|
|
9
|
+
"rollup",
|
|
10
|
+
"dts",
|
|
11
|
+
"bundle",
|
|
12
|
+
"typescript"
|
|
13
|
+
],
|
|
14
|
+
"repository": "https://github.com/f-lawe/unplugin-dts-bundle-generator",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "François Lavaud-Wernert <francois@lavaud.family>",
|
|
17
|
+
"type": "module",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/dts-bundle-generator.d.ts",
|
|
21
|
+
"import": "./dist/dts-bundle-generator.mjs",
|
|
22
|
+
"require": "./dist/dts-bundle-generator.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./vite": {
|
|
25
|
+
"types": "./dist/vite.d.ts",
|
|
26
|
+
"import": "./dist/vite.mjs",
|
|
27
|
+
"require": "./dist/vite.cjs"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"main": "dist/dts-bundle-generator.cjs",
|
|
31
|
+
"module": "dist/dts-bundle-generator.mjs",
|
|
32
|
+
"source": "src/index.ts",
|
|
33
|
+
"types": "dist/dts-bundle-generator.d.ts",
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "vite build",
|
|
36
|
+
"clean": "rimraf dist",
|
|
37
|
+
"lint": "eslint . --fix && sort-package-json",
|
|
38
|
+
"lint:ci": "eslint . && sort-package-json --check",
|
|
39
|
+
"prepack": "npm run clean && npm run build",
|
|
40
|
+
"typecheck": "tsc --noEmit",
|
|
41
|
+
"typecheck:ci": "tsc --noEmit",
|
|
42
|
+
"watch": "vite build --watch"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"dts-bundle-generator": "^9.3.1",
|
|
46
|
+
"unplugin": "^2.3.5"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@antfu/eslint-config": "^4.16.1",
|
|
50
|
+
"@nuxt/kit": "^3.17.4",
|
|
51
|
+
"@nuxt/schema": "^3.17.4",
|
|
52
|
+
"@types/node": "^24.0.4",
|
|
53
|
+
"eslint": "^9.12.0",
|
|
54
|
+
"jiti": "^2.4.2",
|
|
55
|
+
"rimraf": "^6.0.1",
|
|
56
|
+
"rollup": "^4.41.0",
|
|
57
|
+
"rollup-plugin-node-externals": "^8.0.0",
|
|
58
|
+
"sort-package-json": "^3.3.1",
|
|
59
|
+
"typescript": "^5.0.2",
|
|
60
|
+
"vite": "^7.0.0",
|
|
61
|
+
"webpack": "^5.99.9"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"@nuxt/kit": "^3",
|
|
65
|
+
"@nuxt/schema": "^3",
|
|
66
|
+
"esbuild": "*",
|
|
67
|
+
"rollup": "^3",
|
|
68
|
+
"vite": ">=3",
|
|
69
|
+
"webpack": "^4 || ^5"
|
|
70
|
+
},
|
|
71
|
+
"peerDependenciesMeta": {
|
|
72
|
+
"@nuxt/kit": {
|
|
73
|
+
"optional": true
|
|
74
|
+
},
|
|
75
|
+
"@nuxt/schema": {
|
|
76
|
+
"optional": true
|
|
77
|
+
},
|
|
78
|
+
"esbuild": {
|
|
79
|
+
"optional": true
|
|
80
|
+
},
|
|
81
|
+
"rollup": {
|
|
82
|
+
"optional": true
|
|
83
|
+
},
|
|
84
|
+
"vite": {
|
|
85
|
+
"optional": true
|
|
86
|
+
},
|
|
87
|
+
"webpack": {
|
|
88
|
+
"optional": true
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"engines": {
|
|
92
|
+
"node": ">=22.12.0",
|
|
93
|
+
"npm": ">=10.0.0"
|
|
94
|
+
}
|
|
95
|
+
}
|