quickbundle 0.0.0-next-180c331 → 0.0.0-next-d9c46be
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.mjs +12 -8
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { writeFileSync } from 'node:fs';
|
|
|
16
16
|
import { gzipSize } from 'gzip-size';
|
|
17
17
|
|
|
18
18
|
var name = "quickbundle";
|
|
19
|
-
var version = "0.0.0-next-
|
|
19
|
+
var version = "0.0.0-next-d9c46be";
|
|
20
20
|
|
|
21
21
|
const CWD = process.cwd();
|
|
22
22
|
|
|
@@ -123,13 +123,17 @@ const getBuildableExports = ({ standalone })=>{
|
|
|
123
123
|
const bin = PKG.bin;
|
|
124
124
|
const name = PKG.name;
|
|
125
125
|
const source = PKG.source;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
if (isRecord(bin)) {
|
|
127
|
+
return Object.entries(bin).map((data)=>({
|
|
128
|
+
bin: data[0],
|
|
129
|
+
require: data[1],
|
|
130
|
+
source
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
return [
|
|
131
134
|
{
|
|
132
|
-
bin
|
|
135
|
+
// For scoped packages and if the `bin` is defined with a string value, the [scope name is discarded](the scope name is discarded when creating a binary) when creating a binary.
|
|
136
|
+
bin: name.replace(/^(@.*?\/)/, ""),
|
|
133
137
|
require: bin,
|
|
134
138
|
source
|
|
135
139
|
}
|
|
@@ -140,7 +144,7 @@ const getBuildableExports = ({ standalone })=>{
|
|
|
140
144
|
* Following the [package entry-point specification](https://nodejs.org/api/packages.html#package-entry-points),
|
|
141
145
|
* whenever an export object is defined, it take precedence over other classical entry-point fields
|
|
142
146
|
* (such as main, module, and types defined at the root package.json level).
|
|
143
|
-
*/ if (PKG.main
|
|
147
|
+
*/ if ((PKG.main || PKG.module) ?? PKG.types ?? !PKG.exports) {
|
|
144
148
|
throw new Error("Invalid package entry points contract. Use the recommended [`exports` field](https://nodejs.org/api/packages.html#package-entry-points) instead and, for TypeScript-based projects, update the `tsconfig.json` file to resolve it properly (`moduleResolution` must be set to `Bundler` (or `NodeNext`)).");
|
|
145
149
|
}
|
|
146
150
|
const buildableExportFields = [
|