quickbundle 2.14.0 → 2.16.0
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.js +28 -16
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -152,8 +152,8 @@ const clearLog = (...input)=>{
|
|
|
152
152
|
helpers.message(...input);
|
|
153
153
|
};
|
|
154
154
|
|
|
155
|
-
const require = createRequire(import.meta.url);
|
|
156
|
-
const PKG = require(resolveFromExternalDirectory("package.json"));
|
|
155
|
+
const require$1 = createRequire(import.meta.url);
|
|
156
|
+
const PKG = require$1(resolveFromExternalDirectory("package.json"));
|
|
157
157
|
const DEFAULT_OPTIONS = {
|
|
158
158
|
minification: false,
|
|
159
159
|
sourceMaps: false,
|
|
@@ -231,8 +231,9 @@ const getBuildableExports = ({ standalone })=>{
|
|
|
231
231
|
...buildableExportFields
|
|
232
232
|
].includes(field)) {
|
|
233
233
|
if (!singleExport) {
|
|
234
|
-
singleExport = {
|
|
235
|
-
|
|
234
|
+
singleExport = {
|
|
235
|
+
[field]: value
|
|
236
|
+
};
|
|
236
237
|
return [
|
|
237
238
|
".",
|
|
238
239
|
singleExport
|
|
@@ -258,6 +259,12 @@ const getBuildableExports = ({ standalone })=>{
|
|
|
258
259
|
}
|
|
259
260
|
return output;
|
|
260
261
|
};
|
|
262
|
+
const getFileOutput = (filePath)=>{
|
|
263
|
+
return {
|
|
264
|
+
dir: dirname(filePath),
|
|
265
|
+
entryFileNames: basename(filePath)
|
|
266
|
+
};
|
|
267
|
+
};
|
|
261
268
|
const getPlugins = (customPlugins, options)=>{
|
|
262
269
|
return [
|
|
263
270
|
!options.standalone && externals({
|
|
@@ -278,21 +285,26 @@ const getPlugins = (customPlugins, options)=>{
|
|
|
278
285
|
};
|
|
279
286
|
const createMainConfig = (entryPoints, options)=>{
|
|
280
287
|
const { minification, sourceMaps } = options;
|
|
288
|
+
const cjsInput = entryPoints.require;
|
|
281
289
|
const esmInput = entryPoints.import ?? entryPoints.default;
|
|
282
290
|
if (entryPoints.import && entryPoints.default && entryPoints.import !== entryPoints.default) {
|
|
283
291
|
throw new Error("Both `import` and `default` export fields have been defined but with different values. To preserve proper `default` field resolution on the consumer side (i.e. to target ESM format), make sure to provide the same file path for both fields.");
|
|
284
292
|
}
|
|
293
|
+
const commonOutputConfig = {
|
|
294
|
+
importAttributesKey: "with",
|
|
295
|
+
sourcemap: sourceMaps
|
|
296
|
+
};
|
|
285
297
|
const output = [
|
|
286
|
-
|
|
287
|
-
|
|
298
|
+
cjsInput && {
|
|
299
|
+
...commonOutputConfig,
|
|
300
|
+
...getFileOutput(cjsInput),
|
|
288
301
|
format: "cjs",
|
|
289
|
-
inlineDynamicImports: Boolean(options.standalone)
|
|
290
|
-
sourcemap: sourceMaps
|
|
302
|
+
inlineDynamicImports: Boolean(options.standalone)
|
|
291
303
|
},
|
|
292
304
|
esmInput && {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
305
|
+
...commonOutputConfig,
|
|
306
|
+
...getFileOutput(esmInput),
|
|
307
|
+
format: "es"
|
|
296
308
|
}
|
|
297
309
|
].filter(Boolean);
|
|
298
310
|
return {
|
|
@@ -311,9 +323,7 @@ const createTypesConfig = (entryPoints, options)=>{
|
|
|
311
323
|
return {
|
|
312
324
|
input: entryPoints.source,
|
|
313
325
|
output: [
|
|
314
|
-
|
|
315
|
-
file: entryPoints.types
|
|
316
|
-
}
|
|
326
|
+
getFileOutput(entryPoints.types)
|
|
317
327
|
],
|
|
318
328
|
plugins: getPlugins([
|
|
319
329
|
nodeResolve({
|
|
@@ -353,6 +363,7 @@ const createWatchCommand = (program)=>{
|
|
|
353
363
|
});
|
|
354
364
|
};
|
|
355
365
|
|
|
366
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
356
367
|
const build = async (input)=>{
|
|
357
368
|
process.env.NODE_ENV ??= "production";
|
|
358
369
|
const { data: configurations } = input;
|
|
@@ -369,7 +380,8 @@ const build = async (input)=>{
|
|
|
369
380
|
];
|
|
370
381
|
const promises = [];
|
|
371
382
|
for (const outputEntry of outputEntries){
|
|
372
|
-
const
|
|
383
|
+
const entryFileName = outputEntry.entryFileNames;
|
|
384
|
+
const outputFilePath = join(outputEntry.dir ?? "", typeof entryFileName === "string" ? entryFileName : "");
|
|
373
385
|
if (!outputFilePath) {
|
|
374
386
|
throw new Error("Misconfigured file entry point. Make sure to define an `import`, `require`, or `default` field.");
|
|
375
387
|
}
|
|
@@ -588,7 +600,7 @@ const formatSize = (bytes)=>{
|
|
|
588
600
|
};
|
|
589
601
|
|
|
590
602
|
var name = "quickbundle";
|
|
591
|
-
var version = "2.
|
|
603
|
+
var version = "2.16.0";
|
|
592
604
|
|
|
593
605
|
const createProgram = (...commandBuilders)=>{
|
|
594
606
|
const program = termost({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quickbundle",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0",
|
|
4
4
|
"description": "The zero-configuration transpiler and bundler for the web",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"library",
|
|
@@ -40,22 +40,22 @@
|
|
|
40
40
|
"dist"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@rollup/plugin-commonjs": "^
|
|
43
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
44
44
|
"@rollup/plugin-json": "^6.1.0",
|
|
45
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
45
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
46
46
|
"@rollup/plugin-url": "^8.0.2",
|
|
47
|
-
"@swc/core": "^1.
|
|
47
|
+
"@swc/core": "^1.15.2",
|
|
48
48
|
"decompress": "^4.2.1",
|
|
49
49
|
"gzip-size": "^7.0.0",
|
|
50
|
-
"rollup": "^4.
|
|
50
|
+
"rollup": "^4.53.3",
|
|
51
51
|
"rollup-plugin-dts": "^6.2.3",
|
|
52
|
-
"rollup-plugin-node-externals": "^8.1.
|
|
52
|
+
"rollup-plugin-node-externals": "^8.1.2",
|
|
53
53
|
"rollup-plugin-swc3": "^0.12.1",
|
|
54
|
-
"termost": "^1.
|
|
54
|
+
"termost": "^1.9.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/decompress": "4.2.7",
|
|
58
|
-
"@types/node": "
|
|
58
|
+
"@types/node": "24.10.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"typescript": "^4.7.0 || ^5.0.0"
|