@divriots/jampack 0.11.4 → 0.11.5

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 CHANGED
File without changes
package/README.md CHANGED
@@ -96,7 +96,7 @@ In a 2nd PASS, `jampack` compresses all untouched assets and keep the same name
96
96
  | Extension | Compressor |
97
97
  | --------------- | --------------------- |
98
98
  | `.html`,`.htm` | [`html-minifier-terser`](https://github.com/terser/html-minifier-terser) |
99
- | `.css` | Best of [`csso`](https://github.com/css/csso) & [`lightningCSS`](https://lightningcss.dev) |
99
+ | `.css` | [`lightningCSS`](https://lightningcss.dev) |
100
100
  | `.js` | [`swc`](https://swc.rs/) |
101
101
  | `.svg` | [`svgo`](https://github.com/svg/svgo) |
102
102
  | `.jpg`,`.jpeg` | [`sharp`](https://sharp.pixelplumbing.com/) |
@@ -18,6 +18,7 @@ export async function compressCSS(originalCode, type) {
18
18
  catch (e) {
19
19
  // Error while processing with lightningcss
20
20
  // Take original code
21
+ // TODO catch SyntaxError and report a Warning
21
22
  }
22
23
  let resultBuffer = undefined;
23
24
  if (lightCSSData && lightCSSData.length < originalCode.length) {
@@ -5,11 +5,6 @@ const default_options = {
5
5
  image: {
6
6
  embed_size: 1500,
7
7
  srcset_min_width: 640,
8
- external: {
9
- process: 'download',
10
- src_include: /.*/,
11
- src_exclude: null,
12
- },
13
8
  compress: true,
14
9
  jpeg: {
15
10
  options: {
@@ -10,11 +10,6 @@ export type Options = {
10
10
  image: {
11
11
  embed_size: number;
12
12
  srcset_min_width: number;
13
- external: {
14
- process: 'download' | 'add-dimensions-only' | 'off';
15
- src_include: RegExp | undefined;
16
- src_exclude: RegExp | null;
17
- };
18
13
  compress: boolean;
19
14
  jpeg: {
20
15
  options: {
package/dist/index.js CHANGED
File without changes
package/dist/optimize.js CHANGED
@@ -184,21 +184,9 @@ async function processImage(htmlfile, $, imgElement, isAboveTheFold) {
184
184
  * Attribute 'decoding'
185
185
  */
186
186
  img.attr('decoding', 'async');
187
- /*
188
- * Check for external images
189
- */
190
187
  if (!isLocal(attrib_src)) {
191
- switch (config.image.external.process) {
192
- case 'off':
193
- // Don't process external images
194
- return;
195
- case 'download':
196
- // Download external image for local processing
197
- break;
198
- case 'add-dimensions-only':
199
- // Only add dimensions of image
200
- return;
201
- }
188
+ // Image not local, don't touch it
189
+ return;
202
190
  }
203
191
  /*
204
192
  * Loading image
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divriots/jampack",
3
- "version": "0.11.4",
3
+ "version": "0.11.5",
4
4
  "description": "Packer for static websites",
5
5
  "author": "Georges Gomes @georges-gomes",
6
6
  "bin": {
@@ -19,9 +19,6 @@
19
19
  "@divriots/cheerio": "1.0.0-rc.12",
20
20
  "@proload/core": "^0.3.3",
21
21
  "@swc/core": "^1.3.57",
22
- "@types/html-minifier-terser": "^7.0.0",
23
- "@types/sharp": "^0.32.0",
24
- "@types/svgo": "^3.0.0",
25
22
  "commander": "^10.0.1",
26
23
  "deepmerge": "^4.3.1",
27
24
  "file-type": "^18.4.0",
@@ -37,22 +34,23 @@
37
34
  "table": "^6.8.1"
38
35
  },
39
36
  "devDependencies": {
37
+ "@types/html-minifier-terser": "^7.0.0",
40
38
  "@types/node": "^16.18.28",
41
39
  "shx": "^0.3.3",
42
40
  "ts-node": "^10.2.1",
43
41
  "tslib": "^2.5.0",
44
42
  "typescript": "^5.0.4"
45
43
  },
46
- "scripts": {
47
- "watch": "pnpm build --watch",
48
- "try": "shx rm -fr demo && cp -R demo_rf demo && node ./dist/index.js ./demo --nocache --onlyoptim",
49
- "build": "shx rm -rf dist && tsc -b",
50
- "lint": "eslint . --ext .ts --config .eslintrc"
51
- },
52
44
  "engines": {
53
45
  "node": ">=14.0.0"
54
46
  },
55
47
  "bugs": "https://github.com/divriots/jampack/issues",
56
48
  "keywords": [],
57
- "types": "dist/index.d.ts"
58
- }
49
+ "types": "dist/index.d.ts",
50
+ "scripts": {
51
+ "watch": "pnpm build --watch",
52
+ "try": "shx rm -fr demo && cp -R demo_rf demo && node ./dist/index.js ./demo --nocache --onlyoptim",
53
+ "build": "shx rm -rf dist && tsc -b",
54
+ "lint": "eslint . --ext .ts --config .eslintrc"
55
+ }
56
+ }