@divriots/jampack 0.28.0 → 0.30.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/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/compress.js +1 -1
- package/dist/config-default.js +1 -2
- package/dist/config-types.d.ts +0 -1
- package/dist/index.js +1 -0
- package/dist/optimize.js +5 -0
- package/dist/state.d.ts +1 -0
- package/package.json +11 -9
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/dist/compress.js
CHANGED
|
@@ -80,7 +80,7 @@ export async function compressFolder(state, exclude) {
|
|
|
80
80
|
spinner.text = getProgressText(state);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
if (!state.
|
|
83
|
+
if (!state.args.sequential_compress) {
|
|
84
84
|
// "Parallel" processing
|
|
85
85
|
await Promise.all(paths.map(compressFile));
|
|
86
86
|
}
|
package/dist/config-default.js
CHANGED
|
@@ -3,7 +3,7 @@ const default_options = {
|
|
|
3
3
|
browserslist: 'defaults', // defaults = '> 0.5%, last 2 versions, Firefox ESR, not dead'
|
|
4
4
|
},
|
|
5
5
|
html: {
|
|
6
|
-
add_css_reset_as: '
|
|
6
|
+
add_css_reset_as: 'off',
|
|
7
7
|
sort_attributes: false,
|
|
8
8
|
},
|
|
9
9
|
css: {
|
|
@@ -61,7 +61,6 @@ const default_options = {
|
|
|
61
61
|
},
|
|
62
62
|
misc: {
|
|
63
63
|
prefetch_links: 'off',
|
|
64
|
-
sequential_compress: false,
|
|
65
64
|
},
|
|
66
65
|
};
|
|
67
66
|
export default default_options;
|
package/dist/config-types.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -39,6 +39,7 @@ program
|
|
|
39
39
|
.option('--onlyoptim', 'Only optimize (PASS 1).')
|
|
40
40
|
.option('--onlycomp', 'Only compress (PASS 2).')
|
|
41
41
|
.option('--cache_folder <cache_folder>', 'Default: .jampack/cache')
|
|
42
|
+
.option('--sequential_compress', 'Whether to perform folder compression sequentially. Reduces memoru footprint on compress. Default: false')
|
|
42
43
|
.option('--cleancache', 'Clean cache before running')
|
|
43
44
|
.option('--nocache', 'Run with no use of cache')
|
|
44
45
|
.action(async (dir, options) => {
|
package/dist/optimize.js
CHANGED
|
@@ -433,6 +433,11 @@ async function processImage(state, htmlfile, img, isAboveTheFold) {
|
|
|
433
433
|
const ifmt = imageToEmbed.format;
|
|
434
434
|
switch (ifmt) {
|
|
435
435
|
case 'svg':
|
|
436
|
+
// When embedded, if the SVG file has width and height attributes (or viewBox without corresponding width/height),
|
|
437
|
+
// the browser respects those attributes over the external <img> tag attributes.
|
|
438
|
+
// TODO update the SVG - meanwhile don't embed it if there are attributes
|
|
439
|
+
if (img.attr('width') || img.attr('height'))
|
|
440
|
+
break;
|
|
436
441
|
datauri = svgToMiniDataURI(imageToEmbed.data.toString());
|
|
437
442
|
break;
|
|
438
443
|
case 'webp':
|
package/dist/state.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@divriots/jampack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"cache-version": {
|
|
5
5
|
"img": "v1",
|
|
6
6
|
"img-ext": "v1"
|
|
@@ -59,17 +59,19 @@
|
|
|
59
59
|
"tslib": "^2.6.2",
|
|
60
60
|
"typescript": "^5.4.5"
|
|
61
61
|
},
|
|
62
|
-
"engines": {
|
|
63
|
-
"node": ">=14.0.0"
|
|
64
|
-
},
|
|
65
|
-
"bugs": "https://github.com/divriots/jampack/issues",
|
|
66
|
-
"keywords": [],
|
|
67
|
-
"types": "dist/index.d.ts",
|
|
68
62
|
"scripts": {
|
|
69
63
|
"watch": "pnpm build --watch",
|
|
70
64
|
"try": "shx rm -fr demo && cp -R demo_drc demo && node ./dist/index.js ./demo --nocache",
|
|
71
65
|
"build": "shx rm -rf dist && tsc -b",
|
|
72
66
|
"lint": "eslint . --ext .ts --config .eslintrc",
|
|
67
|
+
"prepublishOnly": "pnpm build",
|
|
73
68
|
"cleanAllDotJampack": "find -s . | grep '.jampack$' | xargs rm -fr"
|
|
74
|
-
}
|
|
75
|
-
|
|
69
|
+
},
|
|
70
|
+
"engines": {
|
|
71
|
+
"node": ">=14.0.0"
|
|
72
|
+
},
|
|
73
|
+
"bugs": "https://github.com/divriots/jampack/issues",
|
|
74
|
+
"keywords": [],
|
|
75
|
+
"types": "dist/index.d.ts",
|
|
76
|
+
"packageManager": "pnpm@8.15.9+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81"
|
|
77
|
+
}
|