diff --git a/packages/adapter-cloudflare-workers/files/.assetsignore b/packages/adapter-cloudflare-workers/files/.assetsignore new file mode 100644 index 000000000000..c2634cc3650a --- /dev/null +++ b/packages/adapter-cloudflare-workers/files/.assetsignore @@ -0,0 +1,4 @@ +_worker.js +_routes.json +_headers +_redirects diff --git a/packages/adapter-cloudflare-workers/index.js b/packages/adapter-cloudflare-workers/index.js index 8a4f9252d1ac..282930f20b5e 100644 --- a/packages/adapter-cloudflare-workers/index.js +++ b/packages/adapter-cloudflare-workers/index.js @@ -1,4 +1,4 @@ -import { existsSync, readFileSync, writeFileSync } from 'node:fs'; +import { copyFileSync, existsSync, readFileSync, writeFileSync } from 'node:fs'; import { posix, dirname } from 'node:path'; import { execSync } from 'node:child_process'; import esbuild from 'esbuild'; @@ -143,6 +143,8 @@ export default function ({ config = 'wrangler.toml', platformProxy = {} } = {}) ); } + copyFileSync(`${files}/.assetsignore`, `${dirname(main)}/.assetsignore`); + builder.log.minor('Copying assets...'); const bucket_dir = `${site.bucket}${builder.config.kit.paths.base}`; builder.writeClient(bucket_dir);