Skip to content

Commit

Permalink
Merge pull request stereobooster#123 from stereobooster/update-puppeteer
Browse files Browse the repository at this point in the history
Update puppeteer and minimalcss
  • Loading branch information
stereobooster authored Jan 26, 2018
2 parents b45ea4b + 4175e33 commit c40ce22
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 204 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const preloadResources = opt => {
const http2PushManifestItems = [];
const uniqueResources = new Set();
page.on("response", async response => {
const responseUrl = response.url;
const responseUrl = response.url();
if (/^data:/i.test(responseUrl)) return;
const ct = response.headers["content-type"] || "";
const route = responseUrl.replace(basePath, "");
Expand Down
27 changes: 11 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "react-snap",
"version": "1.10.0",
"description":
"Zero-configuration framework-agnostic static prerendering for SPAs",
"description": "Zero-configuration framework-agnostic static prerendering for SPAs",
"main": "index.js",
"author": "stereobooster",
"license": "MIT",
Expand All @@ -16,34 +15,30 @@
"express-history-api-fallback": "^2.2.1",
"highland": "^2.11.1",
"html-minifier": "^3.5.5",
"minimalcss": "^0.3.1",
"minimalcss": "^0.6.3",
"mkdirp": "^0.5.1",
"puppeteer": "^0.11.0",
"puppeteer": "^1.0.0",
"serve-static": "^1.13.1",
"sourcemapped-stacktrace-node": "^2.1.6"
},
"devDependencies": {
"@types/express": "^4.0.38",
"@types/highland": "^2.10.5",
"@types/html-minifier": "^1.1.30",
"@types/mkdirp": "^0.5.1",
"@types/node": "^8.0.46",
"@types/puppeteer": "^0.12.0",
"@types/serve-static": "^1.13.0",
"markdown-toc": "^1.2.0",
"prettier": "1.7.3",
"typescript": "^2.7.0-dev.20171026"
"prettier": "1.7.3"
},
"scripts": {
"toc": "yarn run markdown-toc -i doc/recipes.md",
"test": "echo \"Error: no test specified\" && exit 1",
"precommit": "prettier --write {*,src/*}.{js,json,css}",
"tsc": "tsc -p ."
"precommit": "prettier --write {*,src/*}.{js,json,css}"
},
"bin": {
"react-snap": "./run.js"
},
"files": ["index.js", "run.js", "src/", "vendor/"],
"files": [
"index.js",
"run.js",
"src/",
"vendor/"
],
"reactSnap": {
"destination": "tmp",
"inlineCss": true,
Expand Down
2 changes: 1 addition & 1 deletion src/puppeteer_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const crawl = async opt => {
});
beforeFetch && beforeFetch({ page, route });
await page.setUserAgent(options.userAgent);
await page.goto(pageUrl, { waitUntil: "networkidle" });
await page.goto(pageUrl, { waitUntil: "networkidle0" });
if (options.waitFor) await page.waitFor(options.waitFor);
if (options.crawl) {
const links = await getLinks({ page });
Expand Down
12 changes: 0 additions & 12 deletions tsconfig.json

This file was deleted.

Loading

0 comments on commit c40ce22

Please sign in to comment.