Skip to content

Commit

Permalink
.assetsignore file generation for Cloudflare deployment. It is corres…
Browse files Browse the repository at this point in the history
  • Loading branch information
methanoya committed Dec 5, 2024
1 parent 72a7083 commit 14b662f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/adapter-cloudflare/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { existsSync, writeFileSync } from 'node:fs';
import { copyFileSync, existsSync, writeFileSync } from 'node:fs';
import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
import * as esbuild from 'esbuild';
Expand Down Expand Up @@ -31,6 +31,7 @@ export default function (options = {}) {
}

const files = fileURLToPath(new URL('./files', import.meta.url).href);
const templates = fileURLToPath(new URL('./templates-experimental', import.meta.url).href);
const dest = builder.getBuildDirectory('cloudflare');
const tmp = builder.getBuildDirectory('cloudflare-tmp');

Expand Down Expand Up @@ -74,6 +75,8 @@ export default function (options = {}) {
});
}

copyFileSync(`${templates}/.assetsignore`, `${dest}/.assetsignore`);

builder.copy(`${files}/worker.js`, `${tmp}/_worker.js`, {
replace: {
SERVER: `${relativePath}/index.js`,
Expand Down
1 change: 1 addition & 0 deletions packages/adapter-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"types": "index.d.ts",
"files": [
"files",
"templates-experimental",
"index.js",
"index.d.ts",
"ambient.d.ts"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_worker.js
_routes.json
_headers
_redirects

0 comments on commit 14b662f

Please sign in to comment.