Skip to content

Commit b885405

Browse files
authored
Merge pull request #1939 from a1mersnow/main
fix: watch at prepare & sdk missing
2 parents cd5d653 + a66391a commit b885405

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

Diff for: .changeset/spotty-cows-cry.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/nuxt": patch
3+
---
4+
5+
fix: avoid duplicate definition of `@hey-api/client-nuxt` plugin

Diff for: .changeset/two-fans-train.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/nuxt": patch
3+
---
4+
5+
fix: skip watch mode in prepare step

Diff for: packages/nuxt/src/module.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,18 @@ export default defineNuxtModule<ModuleOptions>({
4848
output: {
4949
path: path.join(nuxt.options.buildDir, 'client'),
5050
},
51-
plugins: ['@hey-api/client-nuxt'],
51+
plugins: (options.config.plugins || []).some((plugin: any) => {
52+
const pluginName = typeof plugin === 'string' ? plugin : plugin.name;
53+
return pluginName === '@hey-api/plugin-nuxt';
54+
})
55+
? []
56+
: ['@hey-api/client-nuxt'],
5257
} satisfies Partial<UserConfig>) as UserConfig;
5358

59+
if (nuxt.options._prepare) {
60+
config.watch = false;
61+
}
62+
5463
const folder = path.resolve(
5564
nuxt.options.rootDir,
5665
typeof config.output === 'string' ? config.output : config.output.path,

0 commit comments

Comments
 (0)