quickbundle 2.5.2 → 2.6.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.mjs +11 -10
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -21,8 +21,7 @@ const isRecord = (value)=>{
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const build = async (configurations)=>{
|
|
24
|
-
|
|
25
|
-
(_process_env = process.env).NODE_ENV ?? (_process_env.NODE_ENV = "production");
|
|
24
|
+
process.env.NODE_ENV ??= "production";
|
|
26
25
|
const output = [];
|
|
27
26
|
for (const config of configurations){
|
|
28
27
|
const initialTime = Date.now();
|
|
@@ -243,14 +242,13 @@ const createBuildCommand = (program)=>{
|
|
|
243
242
|
}
|
|
244
243
|
}).task({
|
|
245
244
|
handler (context) {
|
|
246
|
-
const padding = context.logInput.map((item)=>item.rawSize).reduce((pad, currentRawSize)=>{
|
|
247
|
-
return Math.max(pad, String(currentRawSize).length);
|
|
248
|
-
}, 0) + 2;
|
|
249
245
|
context.logInput.forEach((item)=>{
|
|
250
246
|
helpers.message([
|
|
251
|
-
`${item.rawSize
|
|
252
|
-
`${item.compressedSize
|
|
253
|
-
], {
|
|
247
|
+
`${formatSize(item.rawSize)} raw`,
|
|
248
|
+
`${formatSize(item.compressedSize)} gzip`
|
|
249
|
+
].map((message, index)=>{
|
|
250
|
+
return index === 0 ? message : ` ${message}`;
|
|
251
|
+
}).join("\n"), {
|
|
254
252
|
label: `${item.filename} (took ${item.elapsedTime}ms)`,
|
|
255
253
|
type: "information"
|
|
256
254
|
});
|
|
@@ -273,10 +271,13 @@ const computeBundleSize = async (buildOutput)=>{
|
|
|
273
271
|
};
|
|
274
272
|
return Promise.all(buildOutput.map(async (item)=>computeFileSize(item)));
|
|
275
273
|
};
|
|
274
|
+
const formatSize = (bytes)=>{
|
|
275
|
+
const kiloBytes = bytes / 1000;
|
|
276
|
+
return kiloBytes < 1 ? `${bytes} B` : `${kiloBytes.toFixed(2)} kB`;
|
|
277
|
+
};
|
|
276
278
|
|
|
277
279
|
const watch = (configurations)=>{
|
|
278
|
-
|
|
279
|
-
(_process_env = process.env).NODE_ENV ?? (_process_env.NODE_ENV = "development");
|
|
280
|
+
process.env.NODE_ENV ??= "development";
|
|
280
281
|
const watcher = watch$1(configurations.map((config)=>({
|
|
281
282
|
...config,
|
|
282
283
|
onLog
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quickbundle",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "The zero-configuration transpiler and bundler for the web",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ayoub Adib",
|
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
"@rollup/plugin-json": "^6.1.0",
|
|
53
53
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
54
54
|
"@rollup/plugin-url": "^8.0.2",
|
|
55
|
-
"@swc/core": "^1.7.
|
|
55
|
+
"@swc/core": "^1.7.42",
|
|
56
56
|
"gzip-size": "^7.0.0",
|
|
57
|
-
"rollup": "^4.24.
|
|
57
|
+
"rollup": "^4.24.3",
|
|
58
58
|
"rollup-plugin-dts": "^6.1.1",
|
|
59
59
|
"rollup-plugin-node-externals": "^7.1.3",
|
|
60
60
|
"rollup-plugin-swc3": "^0.12.1",
|
|
61
|
-
"termost": "^0.
|
|
61
|
+
"termost": "^0.18.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@types/node": "
|
|
64
|
+
"@types/node": "22.8.5"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "rollup --config ./src/bundler/config.ts --configPlugin rollup-plugin-swc3",
|