Skip to content

Commit

Permalink
chore: remove own deps optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Apr 4, 2024
1 parent 9e30e9f commit c09f60f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 116 deletions.
97 changes: 0 additions & 97 deletions examples/react-server/vite-plugin-environment-optimize-deps.ts

This file was deleted.

15 changes: 5 additions & 10 deletions examples/react-server/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
defineConfig,
createNodeDevEnvironment,
type PluginOption,
type Plugin,
createServerModuleRunner,
Expand All @@ -10,10 +9,6 @@ import { createDebug, tinyassert, typedBoolean } from "@hiogawa/utils";
import { __global } from "./src/global";
import react from "@vitejs/plugin-react";
import { vitePluginSsrMiddleware } from "../react-ssr/vite.config";
import {
vitePluginEnvironmentOptimizeDeps,
vitePluginFixJsxDEV,
} from "./vite-plugin-environment-optimize-deps";

const debug = createDebug("app");

Expand All @@ -27,10 +22,6 @@ export default defineConfig((env) => ({
preview: new URL("./dist/server/index.js", import.meta.url).toString(),
}),
vitePluginReactServer(),
vitePluginEnvironmentOptimizeDeps({
name: "react-server",
}),
vitePluginFixJsxDEV(),
vitePluginSilenceUseClientBuildWarning(),
],

Expand Down Expand Up @@ -59,6 +50,11 @@ export default defineConfig((env) => ({
// [feedback] same as react-ssr
build: env.isPreview ? { outDir: "dist/client" } : {},

ssr: {
// [feedback] deps optimization platform per environment?
target: env.command === "serve" ? "webworker" : undefined,
},

builder: {
async buildEnvironments(builder, build) {
await build(builder.environments["react-server"]!);
Expand Down Expand Up @@ -87,7 +83,6 @@ function vitePluginReactServer(): PluginOption {
conditions: ["react-server"],
},
dev: {
createEnvironment: createNodeDevEnvironment,
optimizeDeps: {
include: [
"react",
Expand Down
Binary file modified misc/vite-5.2.7.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"prettier": "^3.2.5",
"tsx": "^4.7.1",
"typescript": "^5.4.3",
"vite": "https://github.com/hi-ogawa/vite-environment-examples/raw/96d95bc538b7f53589db72f17e23e75b4e57e960/misc/vite-5.2.7.tgz"
"vite": "file:./misc/vite-5.2.7.tgz"
},
"packageManager": "[email protected]+sha256.4b4efa12490e5055d59b9b9fc9438b7d581a6b7af3b5675eb5c5f447cee1a589",
"volta": {
Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c09f60f

Please sign in to comment.