Comments (2)
Wow that's much more than what I expected. I hope it will help some other people if needed :)
Many thanks to you !!
from remix-v2-server.
This is because the tsconfig that the template comes with has a noEmit flag. Remix takes care of building everything in remix build
-- everything excepts what's happening in your express server file. Adding the middleware to tsconfig won't do anything because of noEmit
.
That part is a bit confusing, but this is why there's a seperate script in package.json
specifically for server.ts
in the build step "build:server": "esbuild --platform=node --format=cjs ./server.ts --outdir=./",
There are a couple ways to fix this:
- Keep using esbuild & update the script:
build:server": "esbuild --platform=node --format=cjs ./server.ts ./server/middlewares/test.ts --outdir=./",
- Don't use esbuild and create a new tsconfig profile for the server.
Option 2 is what we use on mana.wiki as well, since the express server itself is light enough that esbuild performance doesn't make a huge difference https://github.com/manawiki/core/blob/main/package.json#L8
I posted a PR to show how it works: fchevallieratecna/remix-v2-server#1
Note that when deploying, you have to make sure the built files are actually shipped. You may want to change the outDir to somewhere else to simplify the process.
from remix-v2-server.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remix-v2-server.