puppeteer-chromium-resolver
Advanced tools
Comparing version 3.0.0 to 3.0.1
12
index.js
@@ -156,6 +156,11 @@ const path = require('path'); | ||
if (localRevisions && localRevisions.length) { | ||
output('Removing previous local chromium revisions ...'); | ||
output('Checking previous local chromium revisions ...'); | ||
localRevisions = localRevisions.filter(revision => revision !== option.revision); | ||
const cleanupOldVersions = localRevisions.map(revision => browserFetcher.remove(revision)); | ||
await Promise.all([...cleanupOldVersions]); | ||
if (localRevisions.length > option.cacheRevisions) { | ||
localRevisions.sort(); | ||
localRevisions.length -= option.cacheRevisions; | ||
output("Removing useless revisions " + localRevisions.join(", ")); | ||
const cleanupOldVersions = localRevisions.map(revision => browserFetcher.remove(revision)); | ||
await Promise.all([...cleanupOldVersions]); | ||
} | ||
} | ||
@@ -393,2 +398,3 @@ | ||
hosts: [], | ||
cacheRevisions: 2, | ||
retry: 3, | ||
@@ -395,0 +401,0 @@ silent: false |
require("./index.js")({}).then((pcr) => { | ||
//console.log(pcr); | ||
}); |
{ | ||
"name": "puppeteer-chromium-resolver", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Tool to resolve puppeteer and chromium faster, detect local installed chromium, download chromium with custom mirror host, cache chromium revision out of node_modules, test chromium headless being launchable.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -43,2 +43,3 @@ | ||
hosts: ["https://storage.googleapis.com", "https://npm.taobao.org/mirrors"], | ||
cacheRevisions: 2, | ||
retry: 3, | ||
@@ -63,2 +64,7 @@ silent: false | ||
## CHANGELOG | ||
+ v3.0.1 | ||
+ v2.0.2 | ||
- added option cacheRevisions to cache multiple revisions | ||
+ v3.0.0 | ||
@@ -65,0 +71,0 @@ - updated puppeteer-core version to v2.0.0 |
16488
372
78