Skip to content

Commit fcbd996

Browse files
committed
Try to make entire distribution ESM compliant. Might blow everything up. We'll see!
1 parent 3741388 commit fcbd996

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0-beta",
44
"description": "node.js lambda with DynamoDB",
55
"main": "??",
6+
"type": "module",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 1",
89
"build-ts": "tsc",

utils/thumbnails.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import i18n from 'i18next';
1313
import enBack from "../locales/en/apback.json";
1414
import { registerWindow, SVG, Svg } from "@svgdotjs/svg.js";
1515
import { APRenderRep, type IRenderOptions, addPrefix, render } from "@abstractplay/renderer";
16+
import { createSVGWindow } from 'svgdom';
17+
import { customAlphabet } from 'nanoid';
18+
const alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
19+
const generateId = customAlphabet(alphabet, 5);
1620

1721
const REGION = "us-east-1";
1822
const s3 = new S3Client({region: REGION});
@@ -309,9 +313,6 @@ export const handler: Handler = async (event: any, context?: any) => {
309313
["light", contextLight],
310314
["dark", contextDark],
311315
]);
312-
const generateId = await makeIdGenerator();
313-
const svgdom = await import('svgdom');
314-
const { createSVGWindow } = svgdom;
315316
const window = createSVGWindow();
316317
const document = window.document;
317318

0 commit comments

Comments
 (0)