Alexander Kim
Alexander Kim
NNuxt
Created by Alexander Kim on 3/26/2024 in #❓・help
How to correctly use lodash in a nuxt 3 module?
Here's workaround in module.ts
nuxt.hook('vite:extendConfig', (config) => {
config.optimizeDeps = config.optimizeDeps || {}
config.optimizeDeps.include = config.optimizeDeps.include || []
config.optimizeDeps.exclude = config.optimizeDeps.exclude || []

const lodashIndex =
config.optimizeDeps.exclude.indexOf('lodash')
if (lodashIndex > -1) {
config.optimizeDeps.exclude.splice(lodashIndex, 1)
}

if (!config.optimizeDeps.include.includes('lodash')) {
config.optimizeDeps.include.push('lodash')
}
})
nuxt.hook('vite:extendConfig', (config) => {
config.optimizeDeps = config.optimizeDeps || {}
config.optimizeDeps.include = config.optimizeDeps.include || []
config.optimizeDeps.exclude = config.optimizeDeps.exclude || []

const lodashIndex =
config.optimizeDeps.exclude.indexOf('lodash')
if (lodashIndex > -1) {
config.optimizeDeps.exclude.splice(lodashIndex, 1)
}

if (!config.optimizeDeps.include.includes('lodash')) {
config.optimizeDeps.include.push('lodash')
}
})
2 replies
NNuxt
Created by denislu93 on 2/20/2024 in #❓・help
Passing data to Nuxt Layer
@l422y so basically, i could make a "layer" with a tailwind components, the use it in my main app via extends and pass a theme to a layer (colors, sizes, etc) ?
3 replies
NNuxt
Created by Alexander Kim on 1/15/2023 in #❓・help
How to dynamically set body class?
seems like no one has idea about that lol
24 replies
NNuxt
Created by Alexander Kim on 1/15/2023 in #❓・help
How to dynamically set body class?
but it was a bit hacky
24 replies
NNuxt
Created by Alexander Kim on 1/15/2023 in #❓・help
How to dynamically set body class?
i could just call this.head
24 replies
NNuxt
Created by Alexander Kim on 1/15/2023 in #❓・help
How to dynamically set body class?
yeah, i kinda recall it worked in Nuxt2
24 replies
NNuxt
Created by Alexander Kim on 1/15/2023 in #❓・help
How to dynamically set body class?
seems like i have no other way, thanks
24 replies
NNuxt
Created by Alexander Kim on 1/15/2023 in #❓・help
How to dynamically set body class?
thought about it, but isn't it ugly?
24 replies
NNuxt
Created by Alexander Kim on 1/15/2023 in #❓・help
How to dynamically set body class?
any ideas?
24 replies
NNuxt
Created by Alexander Kim on 1/15/2023 in #❓・help
How to dynamically set body class?
nah, i'm using reactivity transform, it works this way. The problem is useHead called only once, so it doesn't change when my reactive ref variable changes.
24 replies