Skip to content

Commit bebaa2d

Browse files
committed
feat: process exit when validation error on production build
1 parent e10b9e5 commit bebaa2d

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

packages/nuxt/playground/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@
1010

1111

1212

13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
1333

1434
# @schemasset/nuxt - auto-generated asset files - DO NOT EDIT THIS SECTION MANUALLY
1535
public/favicon.ico

packages/nuxt/playground/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default defineNuxtConfig({
1515
subdir: "domain-a",
1616
outDir: "public",
1717
},
18-
failOnError: false,
18+
failOnError: true,
1919
},
2020
devtools: { enabled: true },
2121
});

packages/nuxt/src/module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ export default defineNuxtModule<ModuleOptions>({
321321
logger.error(`Schema validation failed, but continuing with asset copying`);
322322
// Don't exit or throw error, continue with asset copying
323323
if (process.env.NODE_ENV === "production" && options.failOnError) {
324-
logger.warn("Production build with validation errors. Set failOnError: false to suppress this warning.");
325-
// Still don't exit, allow copying assets
324+
process.exit(1);
326325
}
327326
}
328327

0 commit comments

Comments
 (0)