vite-plugin-lib 1.1.0 → 1.1.1

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.cjs CHANGED
@@ -37,14 +37,18 @@ const tsconfigPaths = () => {
37
37
  return config;
38
38
  }
39
39
  const aliasOptions = Object.entries(paths).map(
40
- ([alias, replacement]) => ({
41
- find: alias.replace("/*", ""),
42
- replacement: path.resolve(
40
+ ([alias, replacements]) => {
41
+ const find = alias.replace("/*", "");
42
+ const replacement = path.resolve(
43
43
  tsconfigPath,
44
44
  baseUrl,
45
- replacement[0].replace("/*", "")
46
- )
47
- })
45
+ replacements[0]?.replace("/*", "") ?? find
46
+ );
47
+ return {
48
+ find,
49
+ replacement
50
+ };
51
+ }
48
52
  );
49
53
  if (aliasOptions.length > 0) {
50
54
  log(`Injected ${c.green(aliasOptions.length)} aliases.`);
package/dist/index.mjs CHANGED
@@ -24,14 +24,18 @@ const tsconfigPaths = () => {
24
24
  return config;
25
25
  }
26
26
  const aliasOptions = Object.entries(paths).map(
27
- ([alias, replacement]) => ({
28
- find: alias.replace("/*", ""),
29
- replacement: path.resolve(
27
+ ([alias, replacements]) => {
28
+ const find = alias.replace("/*", "");
29
+ const replacement = path.resolve(
30
30
  tsconfigPath,
31
31
  baseUrl,
32
- replacement[0].replace("/*", "")
33
- )
34
- })
32
+ replacements[0]?.replace("/*", "") ?? find
33
+ );
34
+ return {
35
+ find,
36
+ replacement
37
+ };
38
+ }
35
39
  );
36
40
  if (aliasOptions.length > 0) {
37
41
  log(`Injected ${c.green(aliasOptions.length)} aliases.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-lib",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
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",
@@ -44,7 +44,7 @@
44
44
  "typescript": "4.9.4",
45
45
  "unbuild": "1.0.2",
46
46
  "vite": "4.0.0",
47
- "@yeger/tsconfig": "1.1.0"
47
+ "@yeger/tsconfig": "1.1.1"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"