smartbundle 0.3.0-alpha.0 → 0.3.0-alpha.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.
@@ -65,6 +65,7 @@ async function buildVite({
65
65
  return false;
66
66
  },
67
67
  output: {
68
+ exports: "named",
68
69
  preserveModules: true
69
70
  }
70
71
  }
@@ -63,6 +63,7 @@ async function buildVite({
63
63
  return false;
64
64
  },
65
65
  output: {
66
+ exports: "named",
66
67
  preserveModules: true
67
68
  }
68
69
  }
@@ -101,7 +101,7 @@ async function run(args) {
101
101
  }
102
102
  for (const path$1 of exportPath) {
103
103
  setExports(exportsMap, path$1, (entry) => {
104
- entry.mdts = "./" + path.relative(outDir, dts);
104
+ entry.dts = "./" + path.relative(outDir, dts);
105
105
  return entry;
106
106
  });
107
107
  }
@@ -77,7 +77,7 @@ async function run(args) {
77
77
  }
78
78
  for (const path of exportPath) {
79
79
  setExports(exportsMap, path, (entry) => {
80
- entry.mdts = "./" + relative(outDir, dts);
80
+ entry.dts = "./" + relative(outDir, dts);
81
81
  return entry;
82
82
  });
83
83
  }
@@ -9,19 +9,15 @@ async function writePackageJson(outDir, parsed, { exportsMap }) {
9
9
  continue;
10
10
  }
11
11
  const anExport = {};
12
- if (value.mjs || value.mdts) {
13
- anExport.import = {
14
- types: value.mdts,
15
- default: value.mjs
16
- };
12
+ if (value.dts) {
13
+ anExport.types = value.dts;
17
14
  }
18
- if (value.cjs || value.cdts) {
19
- anExport.require = {
20
- types: value.cdts,
21
- default: value.cjs
22
- };
15
+ if (value.mjs) {
16
+ anExport.import = value.mjs;
17
+ }
18
+ if (value.cjs) {
19
+ anExport.require = value.cjs;
23
20
  }
24
- anExport.types = value.mdts;
25
21
  anExport.default = value.mjs;
26
22
  allExports[key] = anExport;
27
23
  }
@@ -7,19 +7,15 @@ async function writePackageJson(outDir, parsed, { exportsMap }) {
7
7
  continue;
8
8
  }
9
9
  const anExport = {};
10
- if (value.mjs || value.mdts) {
11
- anExport.import = {
12
- types: value.mdts,
13
- default: value.mjs
14
- };
10
+ if (value.dts) {
11
+ anExport.types = value.dts;
15
12
  }
16
- if (value.cjs || value.cdts) {
17
- anExport.require = {
18
- types: value.cdts,
19
- default: value.cjs
20
- };
13
+ if (value.mjs) {
14
+ anExport.import = value.mjs;
15
+ }
16
+ if (value.cjs) {
17
+ anExport.require = value.cjs;
21
18
  }
22
- anExport.types = value.mdts;
23
19
  anExport.default = value.mjs;
24
20
  allExports[key] = anExport;
25
21
  }
package/package.json CHANGED
@@ -1,21 +1,16 @@
1
1
  {
2
2
  "name": "smartbundle",
3
3
  "type": "module",
4
- "version": "0.3.0-alpha.0",
4
+ "version": "0.3.0-alpha.1",
5
5
  "bin": "./src/bin.js",
6
6
  "types": "./src/run.d.ts",
7
7
  "module": "./src/run.js",
8
8
  "description": "",
9
9
  "exports": {
10
10
  ".": {
11
- "import": {
12
- "types": "./src/run.d.ts",
13
- "default": "./src/run.js"
14
- },
15
- "require": {
16
- "default": "./src/run.cjs"
17
- },
18
11
  "types": "./src/run.d.ts",
12
+ "import": "./src/run.js",
13
+ "require": "./src/run.cjs",
19
14
  "default": "./src/run.js"
20
15
  }
21
16
  },
@@ -1,9 +1,8 @@
1
1
  import { PackageJson } from "./packageJson.js";
2
2
  export type ExportsObject = {
3
3
  mjs?: string;
4
- mdts?: string;
4
+ dts?: string;
5
5
  cjs?: string;
6
- cdts?: string;
7
6
  };
8
7
  type BuildResult = {
9
8
  exportsMap: Map<string, ExportsObject>;