`nuxt build` 会重写 `.nuxt/tsconfig*.json`, 其中包含用于构建缓存目录的路径
作者: denismrte创建于 2026年9月24日更新于 2026年9月24日
标签5.xpossible regression
nuxt build (which builds into node_modules/.cache/nuxt/.nuxt when .nuxt exists) rewrites all five .nuxt/tsconfig{,.app,.server,.shared,.node}.json that nuxt prepare generated, with paths computed for the build cache directory while the files are written into .nuxt/:
after-prepare: nuxt.schema.ts in the node project: 1, type errors in the app project: 0
after-build: nuxt.schema.ts in the node project: 0, type errors in the app project: 0
after-cache-removal: nuxt.schema.ts in the node project: 0, type errors in the app project: 1compilerOptions.pathsfor#build,#build/*,#imports,#componentsand#app-manifestchange from./imports,., … to../node_modules/.cache/nuxt/.nuxt/imports,../node_modules/.cache/nuxt/.nuxt, …, so the project's types now come from the last production build. Once that cache is gone,#importsno longer resolves:
内容来源: nuxt/nuxt