Skip to content

Commit 31bf76e

Browse files
committed
fix: fixed build:types not exiting when it has errors
1 parent 71fc489 commit 31bf76e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/nuxt/plugins/vue-plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineNuxtPlugin({
1313
const config = useRuntimeConfig().public.witchcraftComponents
1414
const app = (nuxtApp as any).vueApp
1515
const directives = (isArray(config?.directives)
16-
? (await Promise.all(config.directives.map(async (name: string) => (import(`../../directives/${name}.ts`))))).map(_ => Object.values(_)[0])
16+
? (await Promise.all(config.directives.map(async (name: string) => (import(`../../directives/${name}.ts`))))).map((_: any) => Object.values(_)[0])
1717
// @ts-expect-error ts filetype needed for nuxt
1818
: await import(`../../directives/index.ts`))
1919
registerDirectives(app, Object.values(directives))

vite.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ const fileEntries = glob.sync(path.resolve(__dirname, `src/{${folders.join((",")
2323

2424
const typesPlugin = (): PluginOption => ({
2525
name: "typesPlugin",
26-
// process exit is disabled because I'm getting weird problems with vue component types due to experimental features
2726
// eslint-disable-next-line no-console
28-
writeBundle: async () => run(`npm run build:types`).promise.catch(e => { console.log(e.stdout)/* ; process.exit(1) */ }).then(() => undefined),
27+
writeBundle: async () => run(`npm run build:types`).promise.catch(e => { console.log(e); process.exit(1) }).then(() => undefined),
2928
})
3029

3130

0 commit comments

Comments
 (0)