fix(kit,nuxt): ensure webworker types are available

This commit is contained in:
Daniel Roe 2024-07-01 21:00:14 +01:00
parent 7aae4033b8
commit 6bb24c14cc
No known key found for this signature in database
GPG Key ID: CBC814C393D93268
3 changed files with 5 additions and 0 deletions

View File

@ -191,6 +191,7 @@ export async function _generateTypes (nuxt: Nuxt) {
'ESNext',
'dom',
'dom.iterable',
'webworker',
],
/* JSX support for Vue */
jsx: 'preserve',

View File

@ -112,6 +112,9 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
generateTsConfig: true,
tsconfigPath: 'tsconfig.server.json',
tsConfig: {
compilerOptions: {
lib: ['esnext', 'webworker', 'dom.iterable'],
},
include: [
join(nuxt.options.buildDir, 'types/nitro-nuxt.d.ts'),
...modules.map(m => join(relativeWithDot(nuxt.options.buildDir, m), 'runtime/server')),

View File

@ -22,6 +22,7 @@
/* If your code runs in the DOM: */
"lib": [
"es2022",
"webworker",
"dom",
"dom.iterable"
],