vite-plugin-lib 2.1.2 → 2.1.4
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/dist/index.mjs +6 -8
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -60,7 +60,7 @@ function transformStaticImport(file, line, quote, verbose) {
|
|
|
60
60
|
const importPathMarker = `from ${quote}`;
|
|
61
61
|
const isStaticImport = line.includes("import ") && line.includes(`${importPathMarker}.`);
|
|
62
62
|
if (!isStaticImport) {
|
|
63
|
-
return
|
|
63
|
+
return undefined;
|
|
64
64
|
}
|
|
65
65
|
const importStartIndex = line.lastIndexOf(importPathMarker);
|
|
66
66
|
const importPath = line.substring(
|
|
@@ -80,7 +80,7 @@ function transformExport(file, line, quote, verbose) {
|
|
|
80
80
|
const exportPathMarker = ` from ${quote}`;
|
|
81
81
|
const isStaticExport = line.includes("export ") && line.includes(`${exportPathMarker}.`);
|
|
82
82
|
if (!isStaticExport) {
|
|
83
|
-
return
|
|
83
|
+
return undefined;
|
|
84
84
|
}
|
|
85
85
|
const exportStartIndex = line.lastIndexOf(exportPathMarker);
|
|
86
86
|
const exportPath = line.substring(
|
|
@@ -129,7 +129,7 @@ function tsconfigPaths(options = {}) {
|
|
|
129
129
|
return config;
|
|
130
130
|
}
|
|
131
131
|
const pathToAlias = pathToAliasFactory(tsconfigPath, baseUrl, verbose);
|
|
132
|
-
const aliasOptions = Object.entries(paths).map(pathToAlias).filter((alias) => alias !==
|
|
132
|
+
const aliasOptions = Object.entries(paths).map(pathToAlias).filter((alias) => alias !== undefined);
|
|
133
133
|
if (aliasOptions.length > 0) {
|
|
134
134
|
logInjectedAliases(aliasOptions, config, verbose);
|
|
135
135
|
}
|
|
@@ -211,7 +211,7 @@ function pathToAliasFactory(tsconfigPath, baseUrl, verbose) {
|
|
|
211
211
|
if (verbose) {
|
|
212
212
|
logWarn(`No replacements for alias ${c.green(alias)}.`);
|
|
213
213
|
}
|
|
214
|
-
return
|
|
214
|
+
return undefined;
|
|
215
215
|
}
|
|
216
216
|
if (verbose && replacements.length > 1) {
|
|
217
217
|
logWarn(`Found more than one replacement for alias ${c.green(alias)}.`);
|
|
@@ -228,7 +228,7 @@ function pathToAliasFactory(tsconfigPath, baseUrl, verbose) {
|
|
|
228
228
|
if (verbose) {
|
|
229
229
|
logWarn(`No replacement found for alias ${c.green(alias)}.`);
|
|
230
230
|
}
|
|
231
|
-
return
|
|
231
|
+
return undefined;
|
|
232
232
|
}
|
|
233
233
|
return {
|
|
234
234
|
find,
|
|
@@ -245,11 +245,9 @@ function getFirstExistingReplacement(tsconfigPath, baseUrl, replacements, find,
|
|
|
245
245
|
);
|
|
246
246
|
if (existsSync(resolvedReplacement)) {
|
|
247
247
|
return resolvedReplacement;
|
|
248
|
-
} else if (verbose) {
|
|
249
|
-
logWarn(`Path ${c.green(replacement)} does not exist.`);
|
|
250
248
|
}
|
|
251
249
|
}
|
|
252
|
-
return
|
|
250
|
+
return undefined;
|
|
253
251
|
}
|
|
254
252
|
function formatToFileName(entry, format) {
|
|
255
253
|
const entryFileName = entry.substring(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-lib",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"description": "Vite plugin for build configuration, automatic aliases, and type declarations.",
|
|
5
5
|
"author": "Jan Müller <janmueller3698@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
],
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"typescript": "*",
|
|
38
|
-
"vite": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0"
|
|
38
|
+
"vite": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"picocolors": "1.1.
|
|
42
|
-
"vite-plugin-dts": "4.
|
|
41
|
+
"picocolors": "1.1.1",
|
|
42
|
+
"vite-plugin-dts": "4.5.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@types/node": "22.7
|
|
46
|
-
"typescript": "5.
|
|
47
|
-
"unbuild": "
|
|
48
|
-
"vite": "
|
|
49
|
-
"@yeger/tsconfig": "2.0.
|
|
45
|
+
"@types/node": "22.10.7",
|
|
46
|
+
"typescript": "5.7.3",
|
|
47
|
+
"unbuild": "3.3.1",
|
|
48
|
+
"vite": "6.0.7",
|
|
49
|
+
"@yeger/tsconfig": "2.0.9"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|