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

server.js to support typescript #81

Closed
everblaze opened this issue Jan 17, 2021 · 1 comment
Closed

server.js to support typescript #81

everblaze opened this issue Jan 17, 2021 · 1 comment

Comments

@everblaze
Copy link

I had a requirement where building a websocket server for my remix app (some pages use websocket for chat server like functionality).

This lives under the server.js. while building out the functionality I needed to import some code from within my app directory. As this by default typescript and used esm modules. I was unable to import it through node directly.

My work around was to expose the module functions through the global-data.js as it was then compiled for server via typescript and put in a build folder. I was then able to include it from the build folder to get access to my ts module.

Making the server be compiled with typescript would make this include a bit more seemless - however I know this would add complexity in starting as ATM if the build director is empty the server.js can't start (which happens on first run of the app if bulid/cache is cleared).

@chaance
Copy link
Collaborator

chaance commented Apr 20, 2022

This is now possible with the server option in the Remix config. https://remix.run/docs/en/v1/api/conventions#server

@chaance chaance closed this as completed Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants