tsdown-config-silverwind 1.5.6 → 1.6.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.d.ts CHANGED
@@ -14,6 +14,7 @@ declare function base({
14
14
  }: CustomConfig): UserConfig;
15
15
  declare function nodeLib({
16
16
  url,
17
+ outputOptions,
17
18
  ...other
18
19
  }: CustomConfig): UserConfig;
19
20
  declare function webLib({
@@ -22,7 +23,8 @@ declare function webLib({
22
23
  }: CustomConfig): UserConfig;
23
24
  declare function nodeCli({
24
25
  url,
26
+ outputOptions,
25
27
  ...other
26
28
  }: CustomConfig): UserConfig;
27
29
  //#endregion
28
- export { CustomConfig, base, nodeCli, nodeLib, webLib };
30
+ export { base, nodeCli, nodeLib, webLib };
package/dist/index.js CHANGED
@@ -1,26 +1,12 @@
1
1
  import { fileURLToPath } from "node:url";
2
- import { platform } from "node:os";
3
2
 
4
3
  //#region index.ts
5
4
  function isObject(obj) {
6
5
  return Object.prototype.toString.call(obj) === "[object Object]";
7
6
  }
8
- function fixWindowsPath(entry) {
9
- return entry.replaceAll("\\", "/");
10
- }
11
- function fixEntry(entry) {
12
- if (!entry) return entry;
13
- if (platform() !== "win32") return entry;
14
- if (typeof entry === "string") return fixWindowsPath(entry);
15
- else if (Array.isArray(entry)) return entry.map((entry$1) => fixWindowsPath(entry$1));
16
- else if (isObject(entry)) return Object.fromEntries(Object.entries(entry).map(([key, value]) => {
17
- return [key, fixWindowsPath(value)];
18
- }));
19
- else return entry;
20
- }
21
7
  function base({ url, entry, report, loader, outputOptions, ...other }) {
22
8
  return {
23
- entry: fixEntry(entry ?? fileURLToPath(new URL("index.ts", url))),
9
+ entry: entry ?? fileURLToPath(new URL("index.ts", url)),
24
10
  report: typeof report === "boolean" ? report : {
25
11
  gzip: false,
26
12
  brotli: false,
@@ -39,14 +25,19 @@ function base({ url, entry, report, loader, outputOptions, ...other }) {
39
25
  },
40
26
  fixedExtension: false,
41
27
  failOnWarn: true,
28
+ globImport: false,
42
29
  ...other
43
30
  };
44
31
  }
45
- function nodeLib({ url, ...other }) {
32
+ function nodeLib({ url, outputOptions, ...other }) {
46
33
  return base({
47
34
  platform: "node",
48
35
  sourcemap: false,
49
36
  minify: false,
37
+ outputOptions: {
38
+ inlineDynamicImports: true,
39
+ ...outputOptions
40
+ },
50
41
  url,
51
42
  ...other
52
43
  });
@@ -61,11 +52,15 @@ function webLib({ url, ...other }) {
61
52
  ...other
62
53
  });
63
54
  }
64
- function nodeCli({ url, ...other }) {
55
+ function nodeCli({ url, outputOptions, ...other }) {
65
56
  return nodeLib({
66
57
  platform: "node",
67
58
  sourcemap: false,
68
59
  minify: true,
60
+ outputOptions: {
61
+ inlineDynamicImports: true,
62
+ ...outputOptions
63
+ },
69
64
  url,
70
65
  ...other
71
66
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsdown-config-silverwind",
3
- "version": "1.5.6",
3
+ "version": "1.6.1",
4
4
  "description": "Shared tsdown configuration",
5
5
  "author": "silverwind <me@silverwind.io>",
6
6
  "repository": "silverwind/tsdown-config-silverwind",