@jk2908/solas 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/adapters/cloudflare/vite.js +9 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -48,17 +48,18 @@ async function findAssetDirs(root, found = []) {
|
|
|
48
48
|
* renders RSC otherwise
|
|
49
49
|
* - `dist/.solas/**` (runtime manifest + ppr artifacts) at `<prefix>`, read back
|
|
50
50
|
* through the `ASSETS` binding
|
|
51
|
+
* - `dist/sitemap.xml` at the asset root, so `/sitemap.xml` is served
|
|
51
52
|
*/
|
|
52
53
|
async function copyOutput(cwd) {
|
|
53
54
|
const outDir = path.join(cwd, Config.OUT_DIR);
|
|
54
55
|
const artifactSource = path.join(outDir, Config.GENERATED_DIR);
|
|
55
56
|
const staticSource = path.join(outDir, 'static');
|
|
57
|
+
const sitemapSource = path.join(outDir, 'sitemap.xml');
|
|
56
58
|
const assetDirs = await findAssetDirs(path.join(cwd, '.cloudflare', 'output'));
|
|
57
59
|
// Cloudflare compresses at the edge, so the Worker must serve uncompressed
|
|
58
|
-
// bytes.
|
|
59
|
-
// Worker the
|
|
60
|
-
//
|
|
61
|
-
// `content-encoding`). Skip the siblings so the Worker serves the original.
|
|
60
|
+
// bytes. Keeping a `.br`/`.gz` sibling makes the assets binding hand the
|
|
61
|
+
// Worker the compressed body, which the edge compresses again, producing a
|
|
62
|
+
// double-encoded response (or one that does not match its `content-encoding`)
|
|
62
63
|
const skipPrecompressed = (source) => !/\.(br|gz)$/.test(source);
|
|
63
64
|
for (const assetDir of assetDirs) {
|
|
64
65
|
if (await pathExists(artifactSource)) {
|
|
@@ -75,6 +76,10 @@ async function copyOutput(cwd) {
|
|
|
75
76
|
filter: skipPrecompressed,
|
|
76
77
|
});
|
|
77
78
|
}
|
|
79
|
+
// the sitemap is generated at the output root; serve it at the asset root
|
|
80
|
+
if (await pathExists(sitemapSource)) {
|
|
81
|
+
await fs.copyFile(sitemapSource, path.join(assetDir, 'sitemap.xml'));
|
|
82
|
+
}
|
|
78
83
|
}
|
|
79
84
|
}
|
|
80
85
|
function withAdapterConfig(config) {
|
package/package.json
CHANGED