-
Notifications
You must be signed in to change notification settings - Fork 189
feat(defineConfig): enable conditional return #979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Summary
|
✅ Deploy Preview for nuxt-tailwindcss ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
src/config.ts
Outdated
const _defineConfig = createDefineConfig<Partial<Config>>() | ||
export const defineConfig: typeof _defineConfig = (config) => { | ||
const isNuxt = !!tryUseNuxt() | ||
return isNuxt ? config : isMainFile ? requireModule('.nuxt/tailwind/postcss.mjs') : config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could I get a review here possibly?
The use-case is for IntelliSense - if it is used in Nuxt build-time, just return the defined config.
If it is being loaded from the IntelliSense plugin, return .nuxt/tailwind/postcss.mjs
contents which will in-turn re-import this file/config, so if it is being imported from there, return the object instead of trying to re-require postcss.mjs causing a cyclic import.
Quite fragile stuff, but I'm thinking I could ship it and based on feedback, remove it if not helpful as it is a non-app functionality feature/change.
…to define-config
stupid stuff, the intellisense plugins don't run the config but jiti-import it. need to check for that instead and will reopen when I have something |
@@ -101,7 +107,8 @@ | |||
"packageManager": "[email protected]", | |||
"resolutions": { | |||
"@nuxtjs/tailwindcss": "link:.", | |||
"@nuxt/ui": "npm:@nuxt/ui-edge" | |||
"@nuxt/ui": "npm:@nuxt/ui-edge", | |||
"unicorn-magic": "0.2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ineshbose, do you happen to have more info on why this resolution is necessary? I noticed after updating to 6.14.0 that the docker builds for our app broke, but adding this resolution to our package.json fixed things. But that was just a random troubleshooting step, and I'd be curious about the root cause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - yes it is an odd issue. You can do down this thread to investigate #954, but even I would be slightly confused 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
resolves #842