diff --git a/.gitignore b/.gitignore index 1c6fb60..08a89c5 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ # production /build -/public/sketches +/src/.temp # misc .DS_Store diff --git a/package.json b/package.json index be1d0b5..86550dd 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "start": "next start", "lint": "eslint . --ext .ts,.tsx", "type-check": "tsc --noEmit", - "vercel-build": "yum install libuuid-devel libmount-devel zlib-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/ && npm run build" + "vercel-build": "yum install libuuid-devel libmount-devel zlib-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/ && mkdir -p src/.temp/sketches && cp -r sketches/ src/.temp && npm run build" }, "engines": { "node": "12.x" diff --git a/src/pages/api/preview/[sketch].ts b/src/pages/api/preview/[sketch].ts index 3f6ba94..9eb40de 100644 --- a/src/pages/api/preview/[sketch].ts +++ b/src/pages/api/preview/[sketch].ts @@ -23,7 +23,7 @@ type Res = NodeJS.WritableStream & { const handler = async (req: Req, res: Res) => { res.setHeader('content-type', 'image/png') - const { settings, design, DesignNoiseSeeds, cut, CutNoiseSeeds } = await import(`../../../../sketches/${req.query.sketch || '001'}/index.ts`) + const { settings, design, DesignNoiseSeeds, cut, CutNoiseSeeds } = await import(`.temp/sketches/${req.query.sketch || '001'}/index.ts`) const canvasWidth = req.query.width ? parseInt(req.query.width) : 200 const queryDesignSeeds = req.query.designSeeds ? req.query.designSeeds.split(',') : []