Skip to content

Commit

Permalink
Remove .server/.client module support
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed May 10, 2024
1 parent 13d6d43 commit 9ea13f3
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 416 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 @@ -32,7 +32,7 @@
"node-fetch": "^3.3.2",
"typescript": "^5.1.6",
"vite": "^5.1.0",
"vite-env-only": "^2.0.0",
"vite-env-only": "^2.3.0",
"vite-tsconfig-paths": "^4.2.1",
"wrangler": "^3.24.0"
},
Expand Down
14 changes: 11 additions & 3 deletions integration/helpers/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type { Page } from "@playwright/test";
import { test as base, expect } from "@playwright/test";
import type { VitePluginConfig } from "@react-router/dev";

const js = String.raw;
const reactRouterBin = "node_modules/@react-router/dev/dist/cli.js";
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
const root = path.resolve(__dirname, "../..");
Expand Down Expand Up @@ -43,7 +44,7 @@ export const viteConfig = {
ssr: !args.spaMode,
};

return dedent`
return dedent(js`
import { vitePlugin as reactRouter } from "@react-router/dev";
import envOnly from "vite-env-only";
import tsconfigPaths from "vite-tsconfig-paths";
Expand All @@ -52,11 +53,18 @@ export const viteConfig = {
${await viteConfig.server(args)}
plugins: [
reactRouter(${JSON.stringify(pluginOptions)}),
envOnly(),
envOnly({
denyFiles: {
client: [
/\.server\.(\w+)?$/, // .server files
/(^|\/).server\//, // .server directories
],
},
}),
tsconfigPaths()
],
};
`;
`);
},
};

Expand Down
9 changes: 9 additions & 0 deletions integration/vite-build-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test.beforeAll(async () => {
"vite.config.ts": js`
import { defineConfig } from "vite";
import { vitePlugin as reactRouter } from "@react-router/dev";
import envOnly from "vite-env-only";
import mdx from "@mdx-js/rollup";
export default defineConfig({
Expand All @@ -37,6 +38,14 @@ test.beforeAll(async () => {
plugins: [
mdx(),
reactRouter(),
envOnly({
denyFiles: {
client: [
/\.server\.(\w+)?$/, // .server files
/(^|\/).server\//, // .server directories
],
},
}),
],
});
`,
Expand Down
47 changes: 0 additions & 47 deletions integration/vite-dot-client-test.ts

This file was deleted.

272 changes: 0 additions & 272 deletions integration/vite-dot-server-test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"unified": "^10.1.2",
"unist-util-remove": "^3.1.0",
"vite": "^5.1.0",
"vite-env-only": "^2.0.0",
"vite-env-only": "^2.3.0",
"vite-tsconfig-paths": "^4.2.2",
"wait-on": "^7.0.1"
},
Expand Down
Loading

0 comments on commit 9ea13f3

Please sign in to comment.