-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cloudflare): support pass through bundling of custom file extens…
…ions
- Loading branch information
1 parent
4aa4241
commit a0a031e
Showing
18 changed files
with
227 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@astrojs/cloudflare': minor | ||
--- | ||
|
||
Add support for bundling .bin and .txt files to cloudflare pages functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
packages/cloudflare/test/fixtures/module-loader/src/pages/bin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { type APIContext } from 'astro'; | ||
|
||
import data from '../util/file.bin'; | ||
|
||
export const prerender = false; | ||
|
||
export async function GET( | ||
context: APIContext | ||
): Promise<Response> { | ||
return new Response(data, { | ||
status: 200, | ||
headers: { | ||
'Content-Type': 'binary/octet-stream', | ||
}, | ||
}); | ||
} |
2 changes: 1 addition & 1 deletion
2
...re/test/fixtures/wasm/src/pages/hybrid.ts → ...ixtures/module-loader/src/pages/hybrid.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
packages/cloudflare/test/fixtures/module-loader/src/pages/text.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { type APIContext } from 'astro'; | ||
|
||
import text from '../util/file.txt'; | ||
|
||
export const prerender = false; | ||
|
||
export async function GET( | ||
context: APIContext | ||
): Promise<Response> { | ||
return new Response(text, { | ||
status: 200, | ||
headers: { | ||
'Content-Type': 'text/plain; charset=utf-8', | ||
}, | ||
}); | ||
} |
2 changes: 1 addition & 1 deletion
2
...dflare/test/fixtures/wasm/src/util/add.ts → ...st/fixtures/module-loader/src/util/add.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
packages/cloudflare/test/fixtures/module-loader/src/util/file.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.