Skip to content

Commit f0c820b

Browse files
Rich-Harrisdominikg
authored andcommitted
more validation
1 parent 3e34bb0 commit f0c820b

File tree

1 file changed

+12
-0
lines changed
  • packages/adapter-cloudflare-workers

1 file changed

+12
-0
lines changed

packages/adapter-cloudflare-workers/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,18 @@ function validate_config(builder) {
9494
);
9595
}
9696

97+
// @ts-ignore
98+
if (!wrangler_config.build || !wrangler_config.build.upload) {
99+
throw new Error(
100+
'You must specify build.upload options in wrangler.toml. Consult https://github.com/sveltejs/kit/tree/master/packages/adapter-cloudflare-workers'
101+
);
102+
}
103+
104+
// @ts-ignore
105+
if (wrangler_config.build.upload.format !== 'modules') {
106+
throw new Error('build.upload.format in wrangler.toml must be "modules"');
107+
}
108+
97109
// @ts-ignore
98110
const main_file = wrangler_config.build?.upload?.main;
99111
const main_file_ext = main_file?.split('.').slice(-1)[0];

0 commit comments

Comments
 (0)