Skip to content

Commit 46fe093

Browse files
test
1 parent f205786 commit 46fe093

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

functions/export.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { stringify } from 'query-string'
2+
import { launchChromium } from 'playwright-aws-lambda'
23

34
const scale = 0.75
45
const viewport = {
@@ -10,17 +11,7 @@ export const handler = async (event) => {
1011
const { layers, viewer, lat, lng, center, zoom } = event.queryStringParameters
1112

1213
try {
13-
let browser
14-
15-
if (process.env.NETLIFY_DEV) {
16-
const playwright = await import('playwright-chromium')
17-
browser = await playwright.chromium.launch({
18-
headless: true,
19-
})
20-
} else {
21-
const playwright = await import('playwright-aws-lambda')
22-
browser = await playwright.launchChromium()
23-
}
14+
const browser = await launchChromium()
2415

2516
const page = await browser.newPage({
2617
viewport,

netlify.toml

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
publish = "dist/"
44
functions= "functions"
55

6+
[build.environment]
7+
AWS_LAMBDA_JS_RUNTIME = "nodejs14.21.1"
8+
NODE_VERSION = "v14.21.1"
9+
610
[functions]
711
directory = "functions"
812
node_bundler = "esbuild"

0 commit comments

Comments
 (0)