Incognitus
Incognitus
Explore posts from servers
NNuxt
Created by Incognitus on 10/30/2024 in #❓・help
How to share configs in DDD Nuxt App?
I have flat structure
.
├── app/
│ ├── .playground/
│ │ └── .nuxt.config.ts
│ ├── nuxt.config.ts
│ ├── stores
│ ├── constants
│ └── services
├── auth/
│ ├── .playground/
│ │ └── .nuxt.config.ts
│ └── nuxt.config.ts.
├── nuxt.config.ts
├── package.json
└── .gitignore
.
├── app/
│ ├── .playground/
│ │ └── .nuxt.config.ts
│ ├── nuxt.config.ts
│ ├── stores
│ ├── constants
│ └── services
├── auth/
│ ├── .playground/
│ │ └── .nuxt.config.ts
│ └── nuxt.config.ts.
├── nuxt.config.ts
├── package.json
└── .gitignore
I decided that all my auto-import rools will be in root nuxt.config
import { useLayers } from 'nuxt-layers-utils'

const layers = useLayers(__dirname, {
app: 'app',
auth: 'auth',
})

export default defineNuxtConfig({
extends: layers.extends(),
alias: layers.alias('#'),
compatibilityDate: '2024-04-03',
devtools: { enabled: true },

imports: {
dirs: [
'**/stores',
'**/constants',
'**/services',
'packages',
],
},

modules: ['@nuxt/eslint'],
})
import { useLayers } from 'nuxt-layers-utils'

const layers = useLayers(__dirname, {
app: 'app',
auth: 'auth',
})

export default defineNuxtConfig({
extends: layers.extends(),
alias: layers.alias('#'),
compatibilityDate: '2024-04-03',
devtools: { enabled: true },

imports: {
dirs: [
'**/stores',
'**/constants',
'**/services',
'packages',
],
},

modules: ['@nuxt/eslint'],
})
When I try to pnpm dev in auth/.playground I get error, that myStore is not defined in auth default layout. I thought that root nuxt.config is shared between layers, but turns out its not. How do I have to manage configs, to be able to test them in .playground?
5 replies
NNuxt
Created by Incognitus on 5/8/2023 in #❓・help
How to dynamically set src for image ?
No description
1 replies