diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjs new file mode 100644 index 000000000..66d077a44 --- /dev/null +++ b/.puppeteerrc.cjs @@ -0,0 +1,14 @@ +const isCI = !!process.env.VERCEL_ENV + +/** + * @type {import("puppeteer").Configuration} + */ +module.exports = { + cacheDirectory: '/vercel/.cache/puppeteer', + executablePath: + '/vercel/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome', + chrome: { + skipDownload: isCI, + }, + args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage'], +} diff --git a/puppeteer.config.json b/puppeteer.config.json deleted file mode 100644 index af94e5cc0..000000000 --- a/puppeteer.config.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "cacheDirectory": "/vercel/.cache/puppeteer", - "executablePath": "/vercel/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome", - "args": [ - "--no-sandbox", - "--disable-setuid-sandbox", - "--disable-dev-shm-usage" - ] -} diff --git a/vercel.json b/vercel.json index 270f873dd..7e96b34fa 100644 --- a/vercel.json +++ b/vercel.json @@ -1,5 +1,5 @@ { "buildCommand": "yarn build", - "installCommand": "dnf install -y $(cat chrome-dependencies.txt) && npx browsers install chrome@131.0.6778.204 --path /vercel/.cache/puppeteer && yarn install", + "installCommand": "dnf install -y $(cat chrome-dependencies.txt) && yarn install && npx browsers install chrome@131.0.6778.204 --path /vercel/.cache/puppeteer", "framework": "nextjs" }