quickbundle 2.16.0-next-dfc95be → 2.16.0-next-675fc4b

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.
Files changed (2) hide show
  1. package/dist/index.js +18 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import os from "node:os";
15
15
 
16
16
  //#region package.json
17
17
  var name = "quickbundle";
18
- var version = "2.16.0-next-dfc95be";
18
+ var version = "2.16.0-next-675fc4b";
19
19
 
20
20
  //#endregion
21
21
  //#region src/bundler/build.ts
@@ -29,21 +29,16 @@ const build = async (input) => {
29
29
  if (config.output) {
30
30
  const outputEntries = Array.isArray(config.output) ? config.output : [config.output];
31
31
  const promises = [];
32
- for (const outputEntry of outputEntries) {
33
- const entryFileName = outputEntry.entryFileNames;
34
- const outputFilePath = join(outputEntry.dir ?? "", typeof entryFileName === "string" ? entryFileName : "");
35
- if (!outputFilePath) throw new Error("Misconfigured file entry point. Make sure to define an `import`, `require`, or `default` field.");
36
- promises.push(new Promise((resolve, reject) => {
37
- bundle.write(outputEntry).then(() => {
38
- resolve({
39
- elapsedTime: Date.now() - initialTime,
40
- filePath: outputFilePath
41
- });
42
- }).catch((error) => {
43
- if (error instanceof Error) reject(error);
32
+ for (const outputEntry of outputEntries) promises.push(new Promise((resolve, reject) => {
33
+ bundle.write(outputEntry).then(({ output: rolldownOutput }) => {
34
+ resolve({
35
+ elapsedTime: Date.now() - initialTime,
36
+ filePath: join(outputEntry.dir ?? "", rolldownOutput.find((item) => item.type === "chunk" && item.isEntry)?.fileName ?? "")
44
37
  });
45
- }));
46
- }
38
+ }).catch((error) => {
39
+ if (error instanceof Error) reject(error);
40
+ });
41
+ }));
47
42
  output.push(...await Promise.all(promises));
48
43
  }
49
44
  }
@@ -259,10 +254,16 @@ const createMainConfig = (entryPoints, options) => {
259
254
  };
260
255
  };
261
256
  const createTypesConfig = (entryPoints, options) => {
257
+ const { dir, entryFileNames } = getFileOutput(entryPoints.types);
262
258
  return {
263
259
  input: entryPoints.source,
264
- output: [getFileOutput(entryPoints.types)],
265
- plugins: [...getPlugins(options), dts()]
260
+ output: {
261
+ dir,
262
+ entryFileNames({ name }) {
263
+ return name.endsWith(".d") ? entryFileNames : "";
264
+ }
265
+ },
266
+ plugins: [...getPlugins(options), dts({ emitDtsOnly: true })]
266
267
  };
267
268
  };
268
269
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quickbundle",
3
- "version": "2.16.0-next-dfc95be",
3
+ "version": "2.16.0-next-675fc4b",
4
4
  "description": "The zero-configuration transpiler and bundler for the web",
5
5
  "keywords": [
6
6
  "library",