Skip to content

Commit

Permalink
Merge pull request #11721 from remix-run/pedro/upgrade-vite-env-only
Browse files Browse the repository at this point in the history
upgrade vite-env-only
  • Loading branch information
pcattori committed Jun 25, 2024
2 parents b54a81c + e66e2b8 commit 05a94ec
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 49 deletions.
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.

0 comments on commit 05a94ec

Please sign in to comment.