chore: optimize monorepo build performance (#7419)

This commit is contained in:
Matti Nannt
2026-03-05 11:18:54 +01:00
committed by GitHub
parent f0a93ae092
commit f3e02fa466
6 changed files with 22 additions and 10 deletions

View File

@@ -11,5 +11,5 @@
"strict": true
},
"extends": "@formbricks/config-typescript/js-library.json",
"include": [".", "src", "package.json", "../types/surveys.d.ts", "../database/src/index.ts"]
"include": ["src", "vitest.setup.ts", "package.json", "../types/surveys.d.ts", "../database/src/index.ts"]
}

View File

@@ -32,7 +32,8 @@ export default defineConfig({
},
plugins: [
dts({
rollupTypes: true,
rollupTypes: false,
insertTypesEntry: true,
}) as VitestPluginOption,
copyCompiledAssetsPlugin({
filename: "formbricks",

View File

@@ -31,9 +31,9 @@
},
"scripts": {
"dev": "concurrently -n \"ESM,UMD\" \"vite build --watch --mode dev\" \"BUILD_UMD=true vite build --watch --mode dev\"",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsc && cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build && cross-env NODE_OPTIONS=--max-old-space-size=8192 BUILD_UMD=true vite build",
"build:analyze": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsc && cross-env NODE_OPTIONS=--max-old-space-size=8192 ANALYZE=true vite build",
"build:dev": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsc && cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode dev",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsc --noEmit && cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build && cross-env NODE_OPTIONS=--max-old-space-size=8192 BUILD_UMD=true vite build",
"build:analyze": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsc --noEmit && cross-env NODE_OPTIONS=--max-old-space-size=8192 ANALYZE=true vite build",
"build:dev": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsc --noEmit && cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode dev",
"go": "concurrently -n \"ESM,UMD\" \"vite build --watch --mode dev\" \"BUILD_UMD=true vite build --watch --mode dev\"",
"lint": "eslint src --fix --ext .ts,.js,.tsx,.jsx",
"preview": "vite preview",

View File

@@ -0,0 +1 @@
export * from "./lib/validation/index";

View File

@@ -86,7 +86,7 @@ const config = ({ mode }) => {
lib: {
entry: {
index: resolve(__dirname, "src/index.ts"),
validation: resolve(__dirname, "src/lib/validation/index.ts"),
validation: resolve(__dirname, "src/validation.ts"),
},
formats: ["es"],
},
@@ -104,7 +104,7 @@ const config = ({ mode }) => {
plugins: [
...sharedConfig.plugins,
dts({
rollupTypes: true,
rollupTypes: false,
// Generate separate .d.ts files for each entry point
entryRoot: "src",
}),

View File

@@ -2,7 +2,8 @@
"$schema": "https://turborepo.org/schema.json",
"tasks": {
"@formbricks/cache#build": {
"dependsOn": ["@formbricks/logger#build"]
"dependsOn": ["@formbricks/logger#build"],
"outputs": ["dist/**"]
},
"@formbricks/cache#go": {
"dependsOn": ["@formbricks/logger#build"]
@@ -26,9 +27,13 @@
"@formbricks/database#setup": {
"dependsOn": ["db:up"]
},
"@formbricks/email#build": {
"dependsOn": ["^build"],
"outputs": []
},
"@formbricks/i18n-utils#build": {
"dependsOn": ["^build"],
"outputs": ["packages/i18n-utils/dist/**"]
"outputs": ["dist/**"]
},
"@formbricks/i18n-utils#lint": {
"dependsOn": ["^lint"]
@@ -48,6 +53,10 @@
"@formbricks/js-core#lint": {
"dependsOn": ["@formbricks/database#build"]
},
"@formbricks/logger#build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"@formbricks/react-native#build": {
"dependsOn": ["^build", "@formbricks/database#build"],
"outputs": ["dist/**"]
@@ -58,7 +67,8 @@
"persistent": true
},
"@formbricks/storage#build": {
"dependsOn": ["@formbricks/logger#build"]
"dependsOn": ["@formbricks/logger#build"],
"outputs": ["dist/**"]
},
"@formbricks/storage#go": {
"cache": false,