fix(build): add webpack IgnorePlugin for thread-stream test files; exclude compiled app/ dir from git

- thread-stream test fixtures (intentionally malformed) were being picked
  up by Turbopack during production build, causing 111 compile errors
- IgnorePlugin excludes /test/ within thread-stream context
- thread-stream added to serverExternalPackages to prevent bundling
- /app removed: it is a stale npm-package prebuild artifact, not source code
This commit is contained in:
diegosouzapw
2026-03-23 09:50:21 -03:00
parent e003d58c60
commit e003b17280
2 changed files with 13 additions and 1 deletions

3
.gitignore vendored
View File

@@ -131,3 +131,6 @@ vscode-extension/
*.sqlite-shm
*.sqlite-wal
*.sqlite-journal
# Compiled npm-package build artifact (not source, should not be in git)
/app

View File

@@ -13,6 +13,7 @@ const nextConfig = {
},
output: "standalone",
serverExternalPackages: [
"thread-stream",
"better-sqlite3",
"zod",
"child_process",
@@ -37,8 +38,16 @@ const nextConfig = {
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
webpack: (config, { isServer, webpack }) => {
if (isServer) {
// Webpack IgnorePlugin: skip thread-stream test files that contain
// intentionally broken syntax/imports (they cause Turbopack build errors)
config.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp: /\/test\//,
contextRegExp: /thread-stream/,
})
);
// ── Turbopack / Next.js 16 module-hash patch (#394, #396, #398) ────────
//
// Next.js 16 (with or without Turbopack) compiles the instrumentation hook