tsdown-config-silverwind 1.6.2 → 1.6.3
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.d.ts +2 -0
- package/dist/index.js +11 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare function base({
|
|
|
15
15
|
declare function nodeLib({
|
|
16
16
|
url,
|
|
17
17
|
outputOptions,
|
|
18
|
+
entry,
|
|
18
19
|
...other
|
|
19
20
|
}: CustomConfig): UserConfig;
|
|
20
21
|
declare function webLib({
|
|
@@ -24,6 +25,7 @@ declare function webLib({
|
|
|
24
25
|
declare function nodeCli({
|
|
25
26
|
url,
|
|
26
27
|
outputOptions,
|
|
28
|
+
entry,
|
|
27
29
|
...other
|
|
28
30
|
}: CustomConfig): UserConfig;
|
|
29
31
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,11 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
function isObject(obj) {
|
|
5
5
|
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
6
6
|
}
|
|
7
|
+
function isSingleEntry(entry) {
|
|
8
|
+
if (Array.isArray(entry)) return entry.length === 1;
|
|
9
|
+
else if (isObject(entry)) return Object.keys(entry).length === 1;
|
|
10
|
+
else return true;
|
|
11
|
+
}
|
|
7
12
|
function base({ url, entry, report, loader, outputOptions, ...other }) {
|
|
8
13
|
return {
|
|
9
14
|
entry: entry ?? fileURLToPath(new URL("index.ts", url)),
|
|
@@ -29,13 +34,14 @@ function base({ url, entry, report, loader, outputOptions, ...other }) {
|
|
|
29
34
|
...other
|
|
30
35
|
};
|
|
31
36
|
}
|
|
32
|
-
function nodeLib({ url, outputOptions, ...other }) {
|
|
37
|
+
function nodeLib({ url, outputOptions, entry, ...other }) {
|
|
33
38
|
return base({
|
|
39
|
+
entry,
|
|
34
40
|
platform: "node",
|
|
35
41
|
sourcemap: false,
|
|
36
42
|
minify: false,
|
|
37
43
|
outputOptions: {
|
|
38
|
-
inlineDynamicImports: true,
|
|
44
|
+
...isSingleEntry(entry) && { inlineDynamicImports: true },
|
|
39
45
|
...outputOptions
|
|
40
46
|
},
|
|
41
47
|
url,
|
|
@@ -52,13 +58,14 @@ function webLib({ url, ...other }) {
|
|
|
52
58
|
...other
|
|
53
59
|
});
|
|
54
60
|
}
|
|
55
|
-
function nodeCli({ url, outputOptions, ...other }) {
|
|
61
|
+
function nodeCli({ url, outputOptions, entry, ...other }) {
|
|
56
62
|
return nodeLib({
|
|
63
|
+
entry,
|
|
57
64
|
platform: "node",
|
|
58
65
|
sourcemap: false,
|
|
59
66
|
minify: true,
|
|
60
67
|
outputOptions: {
|
|
61
|
-
inlineDynamicImports: true,
|
|
68
|
+
...isSingleEntry(entry) && { inlineDynamicImports: true },
|
|
62
69
|
...outputOptions
|
|
63
70
|
},
|
|
64
71
|
url,
|