Open lud-hu opened 3 months ago
Same thing here. I managed to solve it by importing the path in nuxt.config.ts
export default defineNuxtConfig({
imports: {
imports: [
{
from: './node_modules/@histoire/plugin-vue/components.d.ts',
type: true,
},
],
},
})
EDIT: The above solution is not what is specified what should be done according to Histoire docs, this is needed:
export default defineNuxtConfig({
hooks: {
'prepare:types': ({
tsConfig,
}) => {
tsConfig?.include?.push('../env.d.ts')
},
},
})
Describe the bug
For TS + nuxt projects, I cannot just do what the docs say about adding the
env.d.ts
into the tsconfig. It will just overwrite the nuxt config and therefore vanish out all auto imports etc. If I copy over the generated tsconfig from the.nuxt
directory it's working, but this is more like a workaround.Reproduction
https://github.com/lud-hu/nuxt-histoire-reproduction/blob/main/tsconfig.json
System Info
Used Package Manager
yarn
Validations