Repository: nuxt/nuxt
File: packages/schema/src/config/vite.ts (TypeScript)

Code before:
   */
  vite: {
    root: {
      $resolve: async (val, get) => typeof val === 'string' ? val : (await get('srcDir')),
    },
    mode: {
      $resolve: async (val, get) => typeof val === 'string' ? val : (await get('dev') ? 'development' : 'production'),
    },
    define: {
      $resolve: async (_val, get) => {
        const [isDev, isDebug] = await Promise.all([get('dev'), get('debug')])
        return {
          '__VUE_PROD_HYDRATION_MISMATCH_DETAILS__': Boolean(isDebug && (isDebug === true || isDebug.hydration)),
          'process.dev': isDev,
          'import.meta.dev': isDev,
          'process.test': isTest,
          'import.meta.test': isTest,
          ..._val && typeof _val === 'object' ? _val : {},
        }
      },
    },
    resolve: {
      extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
      alias: {
        $resolve: async (val, get) => {
          const [srcDir, assetsDir, publicDir] = await Promise.all([get('srcDir'), get('dir.assets'), get('dir.public')])
          return {
            [basename(assetsDir)]: resolve(srcDir, assetsDir),
            [basename(publicDir)]: resolve(srcDir, publicDir),
            ...typeof val === 'object' ? val : {},
          }
        },
      },
    },
    publicDir: {
      // @ts-expect-error this is missing from our `vite` types deliberately, so users do not configure it
      $resolve: (val) => {
        if (val) {
          consola.warn('Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`. You can read more in `https://nuxt.com/docs/api/nuxt-config#public`.')
        }
        return false
      },
    },
    vue: {
      isProduction: {
        $resolve: async (val, get) => typeof val === 'boolean' ? val : !(await get('dev')),
      },
      template: {
        compilerOptions: {
          $resolve: async (val, get) => val ?? (await get('vue')).compilerOptions,
        },

Review comment (suggestion):
```suggestion
          const [srcDir, assetsDir] = await Promise.all([get('srcDir'), get('dir.assets')])
```

Code after:
  vite: {
    root: {
      $resolve: async (val, get) => typeof val === 'string' ? val : (await get('srcDir')),
    },
    mode: {
      $resolve: async (val, get) => typeof val === 'string' ? val : (await get('dev') ? 'development' : 'production'),
    },
    define: {
      $resolve: async (_val, get) => {
        const [isDev, isDebug] = await Promise.all([get('dev'), get('debug')])
        return {
          '__VUE_PROD_HYDRATION_MISMATCH_DETAILS__': Boolean(isDebug && (isDebug === true || isDebug.hydration)),
          'process.dev': isDev,
          'import.meta.dev': isDev,
          'process.test': isTest,
          'import.meta.test': isTest,
          ..._val && typeof _val === 'object' ? _val : {},
        }
      },
    },
    resolve: {
      extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
    },
    publicDir: {
      // @ts-expect-error this is missing from our `vite` types deliberately, so users do not configure it
      $resolve: (val) => {
        if (val) {
          consola.warn('Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`. You can read more in `https://nuxt.com/docs/api/nuxt-config#public`.')
        }
        return false
      },
    },
    vue: {
      isProduction: {
        $resolve: async (val, get) => typeof val === 'boolean' ? val : !(await get('dev')),
      },
      template: {
        compilerOptions: {
          $resolve: async (val, get) => val ?? (await get('vue')).compilerOptions,
        },
        transformAssetUrls: {
          $resolve: async (val, get) => val ?? (await get('vue')).transformAssetUrls,
        },
      },
      script: {
        hoistStatic: {
          $resolve: async (val, get) => typeof val === 'boolean' ? val : (await get('vue')).compilerOptions?.hoistStatic,
        },
      },
      features: {
        propsDestructure: {