nuxt icon indicating copy to clipboard operation
nuxt copied to clipboard

Post CSS plugin issue in nuxt js 2.*

Open Dipakbisen opened this issue 1 year ago • 4 comments

Discussed in https://github.com/nuxt/nuxt.js/discussions/10604

Originally posted by Dipakbisen July 27, 2022 image

nuxt.config.js

build: {
    postcss: {
      plugins: {
        'postcss-url': false,
        lost: true,
        // 'postcss-nested': {},
        // 'postcss-responsive-type': {},
        // 'postcss-hexrgba': {}
      },
      preset: {
        autoprefixer: {
          grid: true,
        },
      },
    },
  },

Dipakbisen avatar Jul 27 '22 05:07 Dipakbisen

I have the same issue. I have tried every variation I have found on the internet and PostCSS just doesn't work.! I have even tried setting the node env with NODE_ENV=production before the command and it just doesn't show the message, but PostCSS plugins are still not applied. I have also tried moving the config to a separate config file and it doesn't work either, I just get a message from nuxt to move it back.

I have nuxt version 2.15.8 installed

This is my config:

build: {
  postcss: {
    plugins: {
      'postcss-easing-gradients': {},
      'postcss-calc': {},
      'postcss-preset-env': {
        autoprefixer: {},
      },
    },
    order: 'presetEnvAndCssnanoLast',
    preset: {
      autoprefixer: {
        grid: true
      }
    }
  },
  extractCSS: true,
}

Preset Env doesn't seem to do anything or it just ignores the browserslist settings in my package.json and the first plugin, postcss-easing-gradients also isn't applied, as the styles that should be transformed by it are untouched in the output.

iamso avatar Jul 27 '22 13:07 iamso

how did you solved it?

plcdnl avatar Aug 19 '22 15:08 plcdnl

+1

vampics avatar Aug 22 '22 12:08 vampics

how did you solved it?

I haven't 😞

iamso avatar Aug 22 '22 14:08 iamso

+1

venimus avatar Nov 25 '22 13:11 venimus

+1

ayushsoni1010 avatar Dec 23 '22 15:12 ayushsoni1010

This should now be resolved in nuxt 2.16.1. Let me know if not with a reproduction and we can reopen.

danielroe avatar Feb 16 '23 05:02 danielroe