gajus / babel-plugin-react-css-modules

Transforms styleName to className using compile time CSS module resolution.
Other
2.05k stars 162 forks source link

Upgrade postcss to 8 #293

Open winston0410 opened 3 years ago

winston0410 commented 3 years ago

I hope this plugin could upgrade its PostCSS version to 8, which is needed for many plugins and it is backward compatible with PostCSS 7

gajus commented 3 years ago

Contributions are welcome.

mikkpokk commented 2 years ago

This ticket needs to be high priority already. Very many packages are migrated to postcss 8 but babel-plugin-react-css-modules are the one which resists to apply those upgrades.

Because of that, many projects have to continue using old vulnerable packages.

Of course I can help upgrading the module, but I believe there are many other contributors who are able to done the job faster since they know under-the-hood of the plugin.

https://evilmartians.com/chronicles/postcss-8-plugin-migration

aaabinbin commented 2 years ago

I have the same pro, I use postcss-nested & less but error

plugins: [
    [
      'react-css-modules',
      {
        filetypes: {
          '.less': {
            syntax: 'postcss-less',
            plugins: ['postcss-nested'],
          },
        },
        autoResolveMultipleImports: true,
        webpackHotModuleReloading: true,
        exclude: 'node_modules',
        generateScopedName: process.env.NODE_ENV === 'development' ? '[local]_[hash:base64:6]' : '[hash:base64:6]'
      },
    ],
  ],
error: PostCSS plugin postcss-nested requires PostCSS 8
/node_modules/babel-plugin-react-css-modules/node_modules/postcss/lib/processor.es6:117:15