Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade vite-env-only #11721

Merged
merged 1 commit into from
Jun 25, 2024
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 integration/helpers/vite-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"eslint": "^8.38.0",
"typescript": "^5.1.6",
"vite": "^5.1.0",
"vite-env-only": "^2.0.0",
"vite-env-only": "^3.0.1",
"vite-tsconfig-paths": "^4.2.1"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions integration/helpers/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ export const viteConfig = {

return dedent`
import { vitePlugin as reactRouter } from "@react-router/dev";
import envOnly from "vite-env-only";
import { envOnlyMacros } from "vite-env-only";
import tsconfigPaths from "vite-tsconfig-paths";

export default {
${await viteConfig.server(args)}
plugins: [
reactRouter(${JSON.stringify(pluginOptions)}),
envOnly(),
envOnlyMacros(),
tsconfigPaths()
],
};
Expand Down
6 changes: 3 additions & 3 deletions integration/vite-dot-server-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,18 @@ test.describe("Vite / server-only escape hatch", async () => {
let files: Files = async ({ port }) => ({
"vite.config.ts": dedent`
import { vitePlugin as reactRouter } from "@react-router/dev";
import envOnly from "vite-env-only";
import { envOnlyMacros } from "vite-env-only";
import tsconfigPaths from "vite-tsconfig-paths";

export default {
${await viteConfig.server({ port })}
plugins: [reactRouter(), envOnly(), tsconfigPaths()],
plugins: [reactRouter(), envOnlyMacros(), tsconfigPaths()],
}
`,
"app/utils.server.ts": serverOnlyModule,
"app/.server/utils.ts": serverOnlyModule,
"app/routes/_index.tsx": `
import { serverOnly$ } from "vite-env-only";
import { serverOnly$ } from "vite-env-only/macros";

import { serverOnly as serverOnlyFile } from "~/utils.server";
import serverOnlyDir from "~/.server/utils";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"unified": "^10.1.2",
"unist-util-remove": "^3.1.0",
"vite": "^5.1.0",
"vite-env-only": "^2.0.0",
"vite-env-only": "^3.0.1",
"vite-tsconfig-paths": "^4.2.2",
"wait-on": "^7.0.1"
},
Expand Down
65 changes: 23 additions & 42 deletions pnpm-lock.yaml

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