Handling of mixed .server
and .client
files inside a single index.ts
file
#9250
-
I'm beginning to migrate from Remix's default compiler to Remix Vite and I'm running into a major issue with the way we structured our app. Inside our folders we use an /**
* @module Firebase
*/
export * from "./firebase.client";
export * from "./firebase-admin.server";
export * from "./firebase.types";
export * from "./firebase.utils"; And then we use tsconfig so we can call I've tried a few things to no evail:
The only thing I've been able to get to work is add the Has anyone else run into this when migrating to Remix Vite? How did you solve the problem? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Here's my current {
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["./cypress", "./cypress.config.ts", "**/*.test.ts"],
"compilerOptions": {
"allowJs": false,
"baseUrl": ".",
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"module": "ES2022",
"moduleResolution": "Bundler",
"noEmit": true, // Remix takes care of building everything in `remix build`.
"paths": {
"@auth": ["app/auth"],
"@components": ["app/components"],
"@components/*": ["app/components/*"],
"@constants": ["app/constants"],
"@db": ["app/db"],
"@db/*": ["app/db/*"],
"@environment": ["app/environment"],
"@hooks": ["app/hooks"],
"@i18n": ["app/i18n"],
"@routes/*": ["app/routes/*"],
"@session": ["app/session"],
"@theme": ["app/theme"],
"@types": ["app/types"],
"@utils": ["app/utils"],
"@app/*": ["app/*"],
"@cypress/*": ["cypress/*"]
},
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "ESNext",
"types": ["cypress", "@testing-library/cypress", "vitest/globals"]
}
} |
Beta Was this translation helpful? Give feedback.
I decided to go with
/sever/
subfolders and having two index files.So I did end up with imports along the lines of
from "@auth"
andfrom "@auth/server"
in the same file but Remix was able to prune everything correctly in that case