Skip to content
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

fix(config): let webpack merge postcss plugins #18839

Merged
merged 1 commit into from Feb 6, 2023

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Feb 6, 2023

πŸ”— Linked issue

resolves #18814
resolves #18798

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Currently we normalize postcss options at config stage, but modules may modify them later, leaving the options in an impossible situation. This PR defers normalizing them until just before passing them to the webpack loader.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link

codesandbox bot commented Feb 6, 2023

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@danielroe danielroe merged commit 6896e10 into 2.x Feb 6, 2023
@danielroe danielroe deleted the fix/normalize-plugins-later branch February 6, 2023 22:59
@HuuNghi
Copy link

HuuNghi commented Feb 8, 2023

When will you deploy this issues?

@danielroe
Copy link
Member Author

Planning for this week - likely Friday.

@danielroe danielroe mentioned this pull request Feb 8, 2023
@LirZeitouny
Copy link

When this fix will be deployed?

@Benyaminrmb
Copy link

should I update nuxt version to apply your fix?

@danielroe
Copy link
Member Author

danielroe commented Feb 16, 2023

Indeed, this fix was released last week in 2.16.1.

@Benyaminrmb
Copy link

Benyaminrmb commented Feb 22, 2023

How can I update ^2.15.7 to 2.16.1?
by changing the package.json file only?
or should I change something in nuxt.config ?

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    transpile: [
      'vue-upload-drop-images',
      'vee-validate/dist/rules',
      'vee-validate/dist/locale/fa',
      'vee-validate/dist/locale/en',
    ],
    postcss: {
      plugins: {
        tailwindcss: {},
        autoprefixer: {},
      },
    },
  },

I updated to new version of nuxt and recive this notice in cmd by running npm run dev command.

i @nuxt/postcss8 is disabled since nuxt has upgraded to postcss v8

Copy link
Member Author

That's not a problem - it's just saying that the @nuxt/postcss8 module (which existed to enable PostCSS 8 support) is not enabled because your version of Nuxt has built-in PostCSS 8 support.

@Benyaminrmb
Copy link

First of all change package.json :

"nuxt": "2.16.1",

Then I added
postcss.config.js:

module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
}

And change
nuxt.config :

build: {
    postcssOptions: {
      plugins:{
        tailwindcss: {},
        autoprefixer: {},
      },
    },
    postcss: {
      postcssOptions: require('./postcss.config.js'),
    },
  },

It's fixed my problem ❀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants