Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"react-test-renderer": "18.3.0-canary-14898b6a9-20240318",
"type-fest": "^4.37.0",
"typescript": "5.8.2",
"vite": "^5.4.11",
"vite": "^6.3.3",
"vitest": "^3.1.2"
},
"sideEffects": false,
Expand Down
14 changes: 10 additions & 4 deletions apps/builder/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ const hasPrivateFolders =
ignore: ["**/node_modules/**"],
}).length > 0;

const conditions = hasPrivateFolders
? ["webstudio-private", "webstudio"]
: ["webstudio"];

export default defineConfig(({ mode }) => {
if (mode === "development") {
// Enable self-signed certificates for development service 2 service fetch calls.
Expand Down Expand Up @@ -65,10 +69,7 @@ export default defineConfig(({ mode }) => {
},
],
resolve: {
conditions: hasPrivateFolders
? ["webstudio-private", "webstudio"]
: ["webstudio"],

conditions: [...conditions, "browser", "development|production"],
alias: [
{
find: "~",
Expand All @@ -82,6 +83,11 @@ export default defineConfig(({ mode }) => {
},
],
},
ssr: {
resolve: {
conditions: [...conditions, "node", "development|production"],
},
},
define: {
"process.env.NODE_ENV": JSON.stringify(mode),
},
Expand Down
2 changes: 1 addition & 1 deletion fixtures/react-router-docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react-router": "^7.5.0",
"vite": "^5.4.11",
"vite": "^6.3.3",
"webstudio": "workspace:*"
},
"private": true,
Expand Down
8 changes: 8 additions & 0 deletions fixtures/react-router-docker/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ import { reactRouter } from "@react-router/dev/vite";

export default defineConfig({
plugins: [reactRouter()],
resolve: {
conditions: ["browser", "development|production"],
},
ssr: {
resolve: {
conditions: ["node", "development|production"],
},
},
});
2 changes: 1 addition & 1 deletion fixtures/react-router-netlify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react-router": "^7.5.0",
"vite": "^5.4.11",
"vite": "^6.3.3",
"webstudio": "workspace:*"
},
"type": "module",
Expand Down
8 changes: 8 additions & 0 deletions fixtures/react-router-netlify/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ import netlifyPlugin from "@netlify/vite-plugin-react-router";

export default defineConfig({
plugins: [reactRouter(), netlifyPlugin()],
resolve: {
conditions: ["browser", "development|production"],
},
ssr: {
resolve: {
conditions: ["node", "development|production"],
},
},
});
2 changes: 1 addition & 1 deletion fixtures/react-router-vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react-router": "^7.5.0",
"vite": "^5.4.11",
"vite": "^6.3.3",
"webstudio": "workspace:*"
},
"private": true,
Expand Down
8 changes: 8 additions & 0 deletions fixtures/react-router-vercel/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ import { reactRouter } from "@react-router/dev/vite";

export default defineConfig({
plugins: [reactRouter()],
resolve: {
conditions: ["browser", "development|production"],
},
ssr: {
resolve: {
conditions: ["node", "development|production"],
},
},
});
4 changes: 2 additions & 2 deletions fixtures/ssg-netlify-by-project-id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"devDependencies": {
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.3.4",
"@vitejs/plugin-react": "^4.4.1",
"prettier": "3.5.3",
"typescript": "5.8.2",
"vite": "^5.4.11",
"vite": "^6.3.3",
"webstudio": "workspace:*"
},
"dependencies": {
Expand Down
8 changes: 8 additions & 0 deletions fixtures/ssg-netlify-by-project-id/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ import vike from "vike/plugin";

export default defineConfig({
plugins: [react(), vike({ prerender: true })],
resolve: {
conditions: ["browser", "development|production"],
},
ssr: {
resolve: {
conditions: ["node", "development|production"],
},
},
});
4 changes: 2 additions & 2 deletions fixtures/ssg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"devDependencies": {
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.3.4",
"@vitejs/plugin-react": "^4.4.1",
"prettier": "3.5.3",
"typescript": "5.8.2",
"vite": "^5.4.11",
"vite": "^6.3.3",
"webstudio": "workspace:*"
},
"dependencies": {
Expand Down
8 changes: 8 additions & 0 deletions fixtures/ssg/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ import vike from "vike/plugin";

export default defineConfig({
plugins: [react(), vike({ prerender: true })],
resolve: {
conditions: ["browser", "development|production"],
},
ssr: {
resolve: {
conditions: ["node", "development|production"],
},
},
});
2 changes: 1 addition & 1 deletion fixtures/webstudio-cloudflare-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@types/react-dom": "^18.2.25",
"fast-glob": "^3.3.2",
"typescript": "5.8.2",
"vite": "^5.4.11",
"vite": "^6.3.3",
"wrangler": "^3.63.2"
}
}
4 changes: 2 additions & 2 deletions fixtures/webstudio-cloudflare-template/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const conditions = hasPrivateFolders

export default defineConfig(({ mode }) => ({
resolve: {
conditions,
conditions: [...conditions, "browser", "development|production"],
},
ssr: {
resolve: {
conditions,
conditions: [...conditions, "node", "development|production"],
},
},
plugins: [
Expand Down
4 changes: 2 additions & 2 deletions fixtures/webstudio-features/.template/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const conditions = hasPrivateFolders

export default defineConfig({
resolve: {
conditions,
conditions: [...conditions, "browser", "development|production"],
},
ssr: {
resolve: {
conditions,
conditions: [...conditions, "node", "development|production"],
},
},
plugins: [reactRouter(), dedupeMeta],
Expand Down
2 changes: 1 addition & 1 deletion fixtures/webstudio-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react-router": "^7.5.0",
"vite": "^5.4.11",
"vite": "^6.3.3",
"webstudio": "workspace:*"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions fixtures/webstudio-features/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const conditions = hasPrivateFolders

export default defineConfig({
resolve: {
conditions,
conditions: [...conditions, "browser", "development|production"],
},
ssr: {
resolve: {
conditions,
conditions: [...conditions, "node", "development|production"],
},
},
plugins: [reactRouter(), dedupeMeta],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/css-tree": "^2.3.1",
"@types/node": "^22.13.10",
"@types/react": "^18.2.70",
"esbuild": "^0.25.1",
"esbuild": "^0.25.3",
"eslint": "^9.22.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-unicorn": "^57.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@types/react-dom": "^18.2.25",
"@types/yargs": "^17.0.33",
"@vercel/react-router": "^1.1.0",
"@vitejs/plugin-react": "^4.3.4",
"@vitejs/plugin-react": "^4.4.1",
"@webstudio-is/css-engine": "workspace:*",
"@webstudio-is/http-client": "workspace:*",
"@webstudio-is/image": "workspace:*",
Expand All @@ -81,7 +81,7 @@
"react-router": "^7.5.0",
"ts-expect": "^1.3.0",
"vike": "^0.4.228",
"vite": "^5.4.11",
"vite": "^6.3.3",
"vitest": "^3.1.2",
"wrangler": "^3.63.2"
}
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/templates/cloudflare/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@ export default defineConfig(({ mode }) => ({
},
}),
].filter(Boolean),
resolve: {
conditions: ["browser", "development|production"],
},
ssr: {
resolve: {
conditions: ["node", "development|production"],
},
},
}));
2 changes: 1 addition & 1 deletion packages/cli/templates/defaults/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"typescript": "5.8.2",
"vite": "^5.4.11"
"vite": "^6.3.3"
},
"engines": {
"node": ">=20.0.0"
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/templates/defaults/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@ export default defineConfig({
},
}),
],
resolve: {
conditions: ["browser", "development|production"],
},
ssr: {
resolve: {
conditions: ["node", "development|production"],
},
},
});
8 changes: 8 additions & 0 deletions packages/cli/templates/react-router-netlify/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ import netlifyPlugin from "@netlify/vite-plugin-react-router";

export default defineConfig({
plugins: [reactRouter(), netlifyPlugin()],
resolve: {
conditions: ["browser", "development|production"],
},
ssr: {
resolve: {
conditions: ["node", "development|production"],
},
},
});
2 changes: 1 addition & 1 deletion packages/cli/templates/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react-router": "^7.5.0",
"vite": "^5.4.11"
"vite": "^6.3.3"
},
"devDependencies": {
"@types/react": "^18.2.70",
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/templates/react-router/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ import { reactRouter } from "@react-router/dev/vite";

export default defineConfig({
plugins: [reactRouter()],
resolve: {
conditions: ["browser", "development|production"],
},
ssr: {
resolve: {
conditions: ["node", "development|production"],
},
},
});
4 changes: 2 additions & 2 deletions packages/cli/templates/saas-helpers/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const conditions = hasPrivateFolders

export default defineConfig(({ mode }) => ({
resolve: {
conditions,
conditions: [...conditions, "browser", "development|production"],
},
ssr: {
resolve: {
conditions,
conditions: [...conditions, "node", "development|production"],
},
},
plugins: [
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/templates/ssg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"devDependencies": {
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.3.4",
"@vitejs/plugin-react": "^4.4.1",
"typescript": "5.8.2",
"vite": "^5.4.11"
"vite": "^6.3.3"
},
"engines": {
"node": ">=20.0.0"
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/templates/ssg/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ import vike from "vike/plugin";

export default defineConfig({
plugins: [react(), vike({ prerender: true })],
resolve: {
conditions: ["browser", "development|production"],
},
ssr: {
resolve: {
conditions: ["node", "development|production"],
},
},
});
Loading