-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use esbuild to build server-side code #7809
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 8cdf849:
|
43da897
to
ee2844e
Compare
5f07b9b
to
368583b
Compare
ee2844e
to
9c90b2b
Compare
Following up from Slack, are the new functions |
Hi @jlarmstrongiv, I don't think they are and we typically want to be conservative in what we |
@dcousens Ahh, I had missed that I’m building my own “start” function to return the underlying express server for experimental aws lambda support and bundling. If I can get that to work, then I should be able to make a pr for an experimental |
9c90b2b
to
ff9d7f9
Compare
Before merging this, we should make sure source maps work (we might want to skip source maps for the prod build but they should definitely work in dev) |
d2f2f81
to
587765a
Compare
734bad1
to
bfbbe40
Compare
bfbbe40
to
ee0c492
Compare
Source maps turned into a rabbit hole, doing it Correctly would be very subtle so let's go with no source maps for now rather than wrong source maps. The bundle that esbuild generates is reasonably readable so I don't think it's a huge concern. |
b15813a
to
d42708a
Compare
d42708a
to
8822d6b
Compare
Requires #7805
While reviewing #7744 - the
pirates
changes demonstrated that we should simplify the build process for end developer configurations.Keystone passes compiling to
next/babel
at the moment, but that is executed in a way that isn't actually helping us drop the responsibility, nor the maintenance burden. We are operating in a constrained environment, with no configuration options for our users. This could be simpler.Some options
tsc
, slower 🐌 , no bundling 😶🌫️esbuild
, fast 💨, easy bundling 📦, limited configuration ❤This pull request switches
@keystone-6/core
to useesbuild
for the compilation process.This change should ideally not break most users, the reality of modules in the JS ecosystem is that every tools does things ever so subtly different so there will likely be small breaks, the most notable change though is that
__dirname
,__filename
, andrequire.resolve
will not be treated specially, this essentially means in most cases, they should just be avoided. If you need to read a file/etc., you should do it relative toprocess.cwd()
.