-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: add support for Vite #137
Conversation
✅ Deploy Preview for remix-edge-on ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for remix-on ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
remix.init/index.js
Outdated
if (useEdge) { | ||
await copyTemplateFiles(rootDirectory); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
somewhat NIT, but this setup with edge overwriting "default" lambda/function is a bit hard to track (what's different between them, what's common etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I did consider handling all lambda-specific files in the same way as edge, but in the end I wanted to ensure the template would at least build if init hadn't run. An alternative might be to set the "build"
command to "remix init", and have that overwrite the command. In fact, I think I'll do that.
|
||
// Remove the auto-init command from the scripts | ||
for (const script of ["build", "start", "dev"]) { | ||
scripts[script] = scripts[script]?.replace("remix init && ", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pieh here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we have concerns for mutating package.json
and possibly causing surprising modifications and git tracking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to mutate it anyway, because they each have different dependencies. In almost all cases this is run as part of the template setup from create-remix
, which commits the changed files. Even in the case where it's run from the package.json command there'll still be a stack of modifications anyway because we're moving all the files around to setup the template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was mostly thinking about cases when it wouldn't run at init for some reason (I did assume that template init does handle commiting initial modifications), but in this case there's not much for us to do, possibly than try to recognize it's not init execution and maybe print message / try to commit ourselves (but this is can of worms and probably leaving user with modified files and letting them handle it is better than trying to handle that ourselves)
Description
Updates the template to use Vite. This is based on the default Remix Vite template. There's far less mucking about needed, so I've simplified the init script a lot.