-
Notifications
You must be signed in to change notification settings - Fork 28
fix: support npm run dev (remix dev) and Netlify CLI #95
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
fix: support npm run dev (remix dev) and Netlify CLI #95
Conversation
✅ Deploy Preview for remix-edge-on ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@@ -2,6 +2,7 @@ node_modules | |||
|
|||
/.cache | |||
/public/build | |||
/build |
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.
remix dev
generates these artifacts as well as those in /public/build
The behaviour for all other frameworks is for |
I'll try that out. |
@@ -4,7 +4,7 @@ | |||
"scripts": { | |||
"build": "remix build", | |||
"dev": "remix dev", | |||
"start": "cross-env NODE_ENV=production netlify dev", | |||
"start": "netlify serve", |
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.
Using ntl serve as it makes more sense in this context.
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'd normally expect start
to run dev
, but I guess it could go either way. Adding a serve
command could be good.
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.
Was going with your suggestion from the other day unless I was dreaming. 🙃 . Using serve avoids running build explicitly which is nice and ntl dev still gives us dev mode
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.
What I meant was that if people wanted the previous behaviour (i.e. running the prod server) then they could use ntl serve instead
@@ -1,9 +1,9 @@ | |||
const baseConfig = | |||
process.env.NETLIFY || process.env.NETLIFY_LOCAL | |||
process.env.NODE_ENV === "production" |
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'll only pull in the custom server settings if building for production, i.e. ntl serve
, ntl build
,ntl deploy
or via git push.
Giving you a tag @whitep4nth3r as we'll be syncing up on this Thursday. |
8b6cb08
to
c5b842d
Compare
remix.init/_app_redirects
Outdated
@@ -0,0 +1,10 @@ | |||
# This file is being used instead of the typical Netlify _redirects file in the root of your application |
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 renamed it from _custom_redirects
to _app_redirects
@whitep4nth3r. I think it conveys what the file is better along with the comments in the file. Thoughts on the wording? cc: @stephmarie17
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.
Much better I think!
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.
Tested both js and ts with netlify functions, and both work as described 🎉
Co-authored-by: Stephanie <[email protected]>
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.
LGTM!
Description
This fix when the
Functions Template
is selected, allows a developer to usenpm run dev
as they would expect, i.e. runremix dev
and at the same time allow for use of the Netlify CLI (remix watch).Related Tickets & Documents
QA Instructions, Screenshots, Recordings
Ensure that the location is outside of the Netlify Remix template folder, e.g.
../my-remix-app
The npm packages will install.
10 Select Netlify Functions by pressing the ENTER key.
10. Change to the directory of the project you just created, e.g.
../my-remix-app
13. The
netlify.toml
for the project should be the same as the one in this PR.14. Run
npm install
Test
remix dev
Test with Netlify CLI
ntl dev
ntl dev
https://localhost:8888
and the page loads.For us to review and ship your PR efficiently, please perform the following steps:
Test with Netlify CLI
ntl serve
npm run start
ntl serve runs
(not the Remix dev server)_custom_redirects
file gets copied topublic/_redirects
https://localhost:8888
and the page loads.For us to review and ship your PR efficiently, please perform the following steps:
can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
something that`s on fire 🔥 (e.g. incident related), you can skip this step.
guide and passes our tests.
A picture of a cute animal (not mandatory, but encouraged)