vite-plugin-lib 2.1.6 → 2.2.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 +2 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +5 -3
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -46,7 +46,8 @@ export default defineConfig({
|
|
|
46
46
|
formats: ['es'], // optional, default is ['es']
|
|
47
47
|
name: 'YourGlobalUMDName', // optional if format does not include 'umd' or 'iife'
|
|
48
48
|
external: ['some-package'], // optional, default is all node_modules and builtin modules
|
|
49
|
-
manifest: 'package.json', // relative path to package.json, default is package.json
|
|
49
|
+
manifest: 'package.json', // relative path to package.json, default is package.json,
|
|
50
|
+
tsconfig: 'tsconfig.json', // relative path to tsconfig.json, default is tsconfig.json
|
|
50
51
|
}),
|
|
51
52
|
],
|
|
52
53
|
})
|
package/dist/index.d.mts
CHANGED
|
@@ -20,6 +20,8 @@ interface Options {
|
|
|
20
20
|
verbose?: boolean;
|
|
21
21
|
/** Remove any temporary build files. Defaults to `true`. */
|
|
22
22
|
cleanup?: boolean;
|
|
23
|
+
/** Path to the tsconfig file (relative to the project root). Defaults to `./tsconfig.json` */
|
|
24
|
+
tsconfig: string;
|
|
23
25
|
}
|
|
24
26
|
declare function tsconfigPaths(options?: Partial<Options>): Plugin;
|
|
25
27
|
declare function library(options?: Partial<Options>): Plugin[];
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ interface Options {
|
|
|
20
20
|
verbose?: boolean;
|
|
21
21
|
/** Remove any temporary build files. Defaults to `true`. */
|
|
22
22
|
cleanup?: boolean;
|
|
23
|
+
/** Path to the tsconfig file (relative to the project root). Defaults to `./tsconfig.json` */
|
|
24
|
+
tsconfig: string;
|
|
23
25
|
}
|
|
24
26
|
declare function tsconfigPaths(options?: Partial<Options>): Plugin;
|
|
25
27
|
declare function library(options?: Partial<Options>): Plugin[];
|
package/dist/index.mjs
CHANGED
|
@@ -108,7 +108,8 @@ const defaults = {
|
|
|
108
108
|
entry: "src/index.ts",
|
|
109
109
|
formats: ["es"],
|
|
110
110
|
manifest: "package.json",
|
|
111
|
-
cleanup: true
|
|
111
|
+
cleanup: true,
|
|
112
|
+
tsconfig: "./tsconfig.json"
|
|
112
113
|
};
|
|
113
114
|
function mergeWithDefaults(options) {
|
|
114
115
|
return {
|
|
@@ -117,12 +118,12 @@ function mergeWithDefaults(options) {
|
|
|
117
118
|
};
|
|
118
119
|
}
|
|
119
120
|
function tsconfigPaths(options = {}) {
|
|
120
|
-
const { verbose } = mergeWithDefaults(options);
|
|
121
|
+
const { verbose, tsconfig } = mergeWithDefaults(options);
|
|
121
122
|
return {
|
|
122
123
|
name: "vite-plugin-lib:alias",
|
|
123
124
|
enforce: "pre",
|
|
124
125
|
config: async (config) => {
|
|
125
|
-
const tsconfigPath = path.resolve(config.root ?? ".",
|
|
126
|
+
const tsconfigPath = path.resolve(config.root ?? ".", tsconfig);
|
|
126
127
|
const { baseUrl, paths } = await readConfig(tsconfigPath);
|
|
127
128
|
if (!baseUrl || !paths) {
|
|
128
129
|
log("No paths found in tsconfig.json.");
|
|
@@ -273,6 +274,7 @@ function library(options = {}) {
|
|
|
273
274
|
include: `${path.resolve(mergedOptions.entry, "..")}/**`,
|
|
274
275
|
outDir: typesDir,
|
|
275
276
|
staticImport: true,
|
|
277
|
+
tsconfigPath: mergedOptions.tsconfig,
|
|
276
278
|
afterBuild: async () => {
|
|
277
279
|
if (includesESFormat(mergedOptions.formats)) {
|
|
278
280
|
await generateMTSDeclarations(
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-lib",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"description": "Vite plugin for build configuration, automatic aliases, and type declarations.",
|
|
6
6
|
"author": "Jan Müller <janmueller3698@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"picocolors": "1.1.1",
|
|
43
|
-
"vite-plugin-dts": "4.5.
|
|
43
|
+
"vite-plugin-dts": "4.5.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@types/node": "22.
|
|
47
|
-
"typescript": "5.
|
|
48
|
-
"unbuild": "3.
|
|
49
|
-
"vite": "6.
|
|
50
|
-
"@yeger/tsconfig": "2.0
|
|
46
|
+
"@types/node": "22.14.1",
|
|
47
|
+
"typescript": "5.8.3",
|
|
48
|
+
"unbuild": "3.5.0",
|
|
49
|
+
"vite": "6.2.6",
|
|
50
|
+
"@yeger/tsconfig": "2.1.0"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|