withastro / adapters

Home for Astro's core maintained adapters
64 stars 33 forks source link

fix: use absolute path for included files #313

Closed ascorbic closed 3 months ago

ascorbic commented 3 months ago

Changes

The adapter adds an included_files option to the SSR function manifest to ensure that all traced files are included in the bundle. The path is currently relative to the root of the site, which breaks when in a monorepo. This PR changes the path to be absolute, which works everywhere. Using an absolute path is fine because bundling always happens on the same machine as the build.

Fixes #309

Testing

Test deploy: https://66826aaccd6edbca0c286764--fascinating-belekoy-dfd085.netlify.app/

Docs

changeset-bot[bot] commented 3 months ago

πŸ¦‹ Changeset detected

Latest commit: b410221bb094010e19f3536e369bba4fdbdefb18

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

This PR includes changesets to release 2 packages | Name | Type | | ---------------------------------- | ----- | | @astrojs/netlify | Patch | | @test/netlify-hosted-astro-project | 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

github-actions[bot] commented 3 months ago

Snapshots have been released for the following packages:

πŸ¦‹  warn ===============================IMPORTANT!===============================
πŸ¦‹  warn Packages will be released under the experimental--absolute-includes tag
πŸ¦‹  warn ----------------------------------------------------------------------
πŸ¦‹  info npm info @astrojs/cloudflare
πŸ¦‹  info npm info @astrojs/netlify
πŸ¦‹  warn @astrojs/cloudflare is not being published because version 11.0.1 is already published on npm
πŸ¦‹  info @astrojs/netlify is being published because our local version (0.0.0-absolute-includes-20240701095820) has not been published on npm
πŸ¦‹  info Publishing "@astrojs/netlify" at "0.0.0-absolute-includes-20240701095820"
πŸ¦‹  success packages published successfully:
πŸ¦‹  @astrojs/netlify@0.0.0-absolute-includes-20240701095820
πŸ¦‹  Creating git tag...
πŸ¦‹  New tag:  @astrojs/netlify@0.0.0-absolute-includes-20240701095820

Build Log ``` > root@0.0.0 build /home/runner/work/adapters/adapters > turbo run build --filter="@astrojs/*" β€’ Packages in scope: @astrojs/cloudflare, @astrojs/netlify, @astrojs/test-utils β€’ Running build in 3 packages β€’ Remote caching disabled ::group::@astrojs/netlify:build cache miss, executing 54fb8c424a734312 > @astrojs/netlify@0.0.0-absolute-includes-20240701095820 build /home/runner/work/adapters/adapters/packages/netlify > tsc ::endgroup:: ::group::@astrojs/cloudflare:build cache miss, executing 984452774e18a17a > @astrojs/cloudflare@11.0.1 build /home/runner/work/adapters/adapters/packages/cloudflare > tsc ::endgroup:: Tasks: 2 successful, 2 total Cached: 0 cached, 2 total Time: 3.886s ```
mashehu commented 3 months ago

Can confirm that it works now in my monorepo setup! Thanks for the quick fix.