Replies: 2 comments 18 replies
-
This is not possible due to the build. It's recommended to do as much as possible within the Alternatively, you could switch to a monorepo, then make a package for the shared code. I do this with the Epic Workshop app: https://github.com/epicweb-dev/epicshop |
Beta Was this translation helpful? Give feedback.
9 replies
-
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have a question about importing server files into express server file. The current build process is a two step process. First vite build is generated and the esbuild generates the express server build.
there's currently no way to import files from
~/...
because there's no resolution to these files. It all works fine during development but when production build is made, the imported file should reference some file in thebuild/server
directory but that doesn't happenExample
Let's say that i have a logger file in
~/app/utils/logger.server.ts
and i want to import that inserver/index.ts
. Is there a way to do that? Then there's this vicious cycle of importing more files becauselogger.server.ts
importsenv.server.ts
, etc.. First issue is that esbuild doesn't recognize imports with tsconfig paths and then it cannot import.ts
files. If I include these files in thebuild-server.ts
entrypoints, it basically duplicates the files.Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions