-
Notifications
You must be signed in to change notification settings - Fork 188
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
feat(defineConfig): enable conditional return #979
base: main
Are you sure you want to change the base?
Conversation
PR Summary
|
✅ Deploy Preview for nuxt-tailwindcss ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
resolves #842