@divriots/jampack 0.1.4 → 0.1.6

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.
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import sharp from 'sharp';
3
2
  export declare const compressImage: (data: Buffer, resize: sharp.ResizeOptions) => Promise<Buffer | undefined>;
4
3
  export declare function compress(glob: string): Promise<void>;
package/dist/compress.js CHANGED
@@ -41,7 +41,7 @@ const processFile = async (file, stats) => {
41
41
  case '.jpg':
42
42
  case '.jpeg':
43
43
  case '.webp':
44
- case '.gif':
44
+ //case '.gif':
45
45
  const newImageData = await compressImageFile(file);
46
46
  if (newImageData && newImageData.length < result.originalSize) {
47
47
  writeData = newImageData;
@@ -99,7 +99,7 @@ export const compressImage = async (data, resize) => {
99
99
  case 'jpg':
100
100
  case 'jpeg':
101
101
  case 'webp':
102
- case 'gif':
102
+ //case 'gif':
103
103
  return await sharpFile.resize({ ...resize, fit: 'fill', withoutEnlargement: true }).toBuffer();
104
104
  }
105
105
  return undefined;
package/dist/optimize.js CHANGED
@@ -8,7 +8,6 @@ import options from './options.js';
8
8
  import { compressImage } from './compress.js';
9
9
  import svgToMiniDataURI from 'mini-svg-data-uri';
10
10
  import globalState from './state.js';
11
- import { exit } from 'process';
12
11
  async function analyse(file) {
13
12
  console.log('Processing ' + file);
14
13
  const html = (await fs.readFile(path.join(globalState.dir, file))).toString();
@@ -109,7 +108,7 @@ async function processImage(file, $, imgElement) {
109
108
  case 'jpeg':
110
109
  case 'png':
111
110
  case 'webp':
112
- case 'gif':
111
+ //case 'gif':
113
112
  // TODO
114
113
  break;
115
114
  }
@@ -191,8 +190,8 @@ async function processImage(file, $, imgElement) {
191
190
  catch (e) {
192
191
  console.error('Error while processing image');
193
192
  console.error(e);
194
- // exit here until we cover all the issues
195
- exit(1);
193
+ // exit here
194
+ // exit(1);
196
195
  }
197
196
  }
198
197
  function setImageSize(img, meta) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divriots/jampack",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Packer for static websites",
5
5
  "author": "Georges Gomes @georges-gomes",
6
6
  "bin": {