mcansh / remix-fastify

Fastify server request handler for Remix
https://remix-fastify.onrender.com
MIT License
194 stars 29 forks source link

fix asset serving when using a basename #442

Closed iamtomcat closed 3 weeks ago

iamtomcat commented 4 weeks ago

Hey when I use the basename in remix vite plugin and set base in vite locally assets are served at the same basename. But when using your plugin assets are still served at the root in production mode. So just made the change to respect the basename path.

If you want something that is more flexible let me know.

export default defineConfig({
  base: "/platform/",
  plugins: [
    remix({
      basename: "/platform/",
    }),
  ],
})
changeset-bot[bot] commented 4 weeks ago

🦋 Changeset detected

Latest commit: 56604d569be975263d1d1bb8a48c27762c2742c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | --------------------- | ----- | | @mcansh/remix-fastify | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

mcansh commented 3 weeks ago

hey @iamtomcat i still need to look at this locally, but if you rebase the changes from main, it should kick off a preview version of the package for you (and i, and any one else) to test out

iamtomcat commented 3 weeks ago

Cool will do in a bit here!

pkg-pr-new[bot] commented 3 weeks ago

Open in Stackblitz

More templates

- [basic-example-template](https://pkg.pr.new/template/1589bbc3-28bd-4bad-be4d-b51437cc6db6) - [vite-remix](https://pkg.pr.new/template/965a9175-9e9d-4fa0-ad4b-9003537e01a6) - [playground](https://pkg.pr.new/template/d01b4b52-48ac-4625-b27e-a62dde296b02)

pnpm add https://pkg.pr.new/@mcansh/remix-fastify@442

commit: 56604d5

mcansh commented 3 weeks ago

looks to be working great, thanks again (ex: https://github.com/mcansh/remix-fastify-442)

(i really need to add some integration tests here 😅)

iamtomcat commented 3 weeks ago

No worries! The published package link was very useful btw.