|
1 | 1 | const puppeteer = require('puppeteer-core')
|
2 | 2 | const chrome = require('chrome-aws-lambda')
|
3 |
| -const exePath = process.platform === 'win32' ? |
4 |
| - 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe' : |
5 |
| - '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' |
| 3 | +const exePath = |
| 4 | + process.platform === 'win32' |
| 5 | + ? 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe' |
| 6 | + : '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' |
6 | 7 |
|
7 | 8 | const isDev = process.env.NOW_REGION === 'dev1'
|
8 | 9 |
|
@@ -45,7 +46,7 @@ exports.extractCss = async url => {
|
45 | 46 | // Fail silently if it's already enabled
|
46 | 47 | await page.coverage.startCSSCoverage().catch(() => {})
|
47 | 48 |
|
48 |
| - const response = await page.goto(url, {waitUntil: 'networkidle2'}) |
| 49 | + const response = await page.goto(url, { waitUntil: 'networkidle2' }) |
49 | 50 |
|
50 | 51 | // Make sure that we only try to extract CSS from valid pages.
|
51 | 52 | // Bail out if the response is an invalid request (400, 500)
|
@@ -83,7 +84,7 @@ exports.extractCss = async url => {
|
83 | 84 | // we requested is an indication that this was a <style> tag
|
84 | 85 | .filter(styles => styles.url !== url)
|
85 | 86 | // The `text` property contains the actual CSS
|
86 |
| - .map(({text}) => text) |
| 87 | + .map(({ text }) => text) |
87 | 88 | .join('')
|
88 | 89 |
|
89 | 90 | return Promise.resolve(styleSheetsApiCss + coverageCss)
|
|
0 commit comments