fix(ppt): dep injection (#3732)

This commit is contained in:
Vikhyath Mondreti
2026-03-23 21:20:43 -07:00
committed by GitHub
parent 852dc93d39
commit 8eb45e3057
4 changed files with 9 additions and 14 deletions
+4
View File
@@ -33,7 +33,11 @@ let cachedWorkerPath: string | undefined
function getWorkerPath(): string {
if (cachedWorkerPath) return cachedWorkerPath
const candidates = [
path.join(currentDir, '..', '..', 'dist', 'pptx-worker.cjs'),
path.join(currentDir, 'pptx-worker.cjs'),
path.join(process.cwd(), 'apps', 'sim', 'dist', 'pptx-worker.cjs'),
path.join(process.cwd(), 'apps', 'sim', 'lib', 'execution', 'pptx-worker.cjs'),
path.join(process.cwd(), 'dist', 'pptx-worker.cjs'),
path.join(process.cwd(), 'lib', 'execution', 'pptx-worker.cjs'),
]
const found = candidates.find((p) => fs.existsSync(p))
+1 -8
View File
@@ -90,14 +90,7 @@ const nextConfig: NextConfig = {
],
outputFileTracingIncludes: {
'/api/tools/stagehand/*': ['./node_modules/ws/**/*'],
'/*': [
'./node_modules/sharp/**/*',
'./node_modules/@img/**/*',
// pptxgenjs and the PPTX worker are required at runtime by the subprocess.
// Neither has a static import that Next.js can trace, so we include them explicitly.
'./node_modules/pptxgenjs/**/*',
'./lib/execution/pptx-worker.cjs',
],
'/*': ['./node_modules/sharp/**/*', './node_modules/@img/**/*', './dist/pptx-worker.cjs'],
},
experimental: {
optimizeCss: true,
+2 -1
View File
@@ -12,7 +12,8 @@
"dev:webpack": "next dev --webpack",
"dev:sockets": "bun run socket/index.ts",
"dev:full": "bunx concurrently -n \"App,Realtime\" -c \"cyan,magenta\" \"bun run dev\" \"bun run dev:sockets\"",
"build": "next build",
"build": "bun run build:pptx-worker && next build",
"build:pptx-worker": "bun build ./lib/execution/pptx-worker.cjs --target=node --format=cjs --outfile ./dist/pptx-worker.cjs",
"start": "next start",
"prepare": "cd ../.. && bun husky",
"test": "vitest run",