-
Notifications
You must be signed in to change notification settings - Fork 380
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
Undocumented caveat with client-side routing when running Netlify Dev with Parcel #2062
Comments
Here's a repository that reproduces the issue yanneves/netlify-cli-2062 I've added steps to the To try locally, first run Scenario: Parcel bundler has multiple entry files [fail]
# netlify.toml
[dev]
command = "npm run dev:all"
Scenario: Parcel bundler has a single entry file [pass]
# netlify.toml
[dev]
command = "npm run dev:app"
And for completeness here, the commands referenced above are as follows: {
"scripts": {
"dev:all": "parcel index.html styleguide.html",
"dev:app": "parcel index.html"
}
} |
Thanks for the detailed reproduction @yanneves, I was able to reproduce and also noticed that if you use a redirect (remove the I'm still looking into why this doesn't work for rewrites. |
No problem 👌 Ah, interesting - if it's any help, I learned that |
Closing as stale. Please re-open if needed |
I was setting up an existing project that uses Parcel v1 to build to work with
netlify dev
. It was fairly easy to set up_redirects
using parcel-plugin-static-files-copy but I wasn't sure why the client-side routing redirect wouldn't work - and assumed this was just a limitation ofnetlify dev
.In
_redirects
But while moving some scripts around in
package.json
I realised I could make client-side routing by using only one target file in the Parcel command. For example,parcel src/index.html
rather thanparcel src/index.html src/styleguide.html
.I'd love to contribute this to the docs if there's somewhere appropriate. Or we could consider this a bug, where navigating to
localhost:8888/*
should proxyindex.html
andlocalhost:8888/styleguide.html
should findstyleguide.html
before proxying. That would be consistent with Netlify App.The text was updated successfully, but these errors were encountered: