fix(nuxt): transpile app.config files in nitro build (#27342)

This commit is contained in:
Daniel Roe 2024-05-24 20:44:50 +01:00 committed by GitHub
parent faa5178d32
commit 40c81a722a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -161,6 +161,8 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
'nuxt3/dist', 'nuxt3/dist',
'nuxt-nightly/dist', 'nuxt-nightly/dist',
distDir, distDir,
// Ensure app config files have auto-imports injected even if they are pure .js files
...nuxt.options._layers.map(layer => resolve(layer.config.srcDir, 'app.config')),
], ],
traceInclude: [ traceInclude: [
// force include files used in generated code from the runtime-compiler // force include files used in generated code from the runtime-compiler

View File

@ -1,3 +1,4 @@
// eslint-disable-next-line no-undef
export default defineAppConfig({ export default defineAppConfig({
userConfig: 123, userConfig: 123,
nested: { nested: {