@@ -37,8 +37,6 @@ export async function build(projectOpts: ProjectOptions): Promise<void> {
37
37
const require = createRequire ( import . meta. url ) ;
38
38
const openNextDistDir = dirname ( require . resolve ( "@opennextjs/aws/index.js" ) ) ;
39
39
40
- await createWranglerConfigIfNotExistent ( projectOpts ) ;
41
-
42
40
await createOpenNextConfigIfNotExistent ( projectOpts ) ;
43
41
44
42
const { config, buildDir } = await compileOpenNextConfig ( baseDir ) ;
@@ -103,6 +101,10 @@ export async function build(projectOpts: ProjectOptions): Promise<void> {
103
101
// TODO: rely on options only.
104
102
await bundleServer ( projConfig , options ) ;
105
103
104
+ if ( ! projectOpts . skipWranglerConfigCheck ) {
105
+ await createWranglerConfigIfNotExistent ( projectOpts ) ;
106
+ }
107
+
106
108
logger . info ( "OpenNext build complete." ) ;
107
109
}
108
110
@@ -200,10 +202,17 @@ async function createWranglerConfigIfNotExistent(projectOpts: ProjectOptions): P
200
202
201
203
const wranglerConfigPath = join ( projectOpts . sourceDir , "wrangler.jsonc" ) ;
202
204
203
- const answer = await askConfirmation ( "Missing required Wrangler config file, do you want to create one?" ) ;
205
+ const answer = await askConfirmation (
206
+ "No `wrangler.(toml|json|jsonc)` config file found, do you want to create one?"
207
+ ) ;
204
208
205
209
if ( ! answer ) {
206
- console . warn ( "No Wrangler config file created" ) ;
210
+ console . warn (
211
+ "No Wrangler config file created" +
212
+ "\n" +
213
+ "(to avoid this check use the `--skipWranglerConfigCheck` flag or set a `SKIP_WRANGLER_CONFIG_CHECK` environment variable to `yes`)"
214
+ ) ;
215
+ return ;
207
216
}
208
217
209
218
const wranglerConfigTemplate = readFileSync (
0 commit comments