Skip to content
This repository was archived by the owner on Jan 16, 2023. It is now read-only.
This repository was archived by the owner on Jan 16, 2023. It is now read-only.

custom-properties no longer applied after upgrade to CRA2 #5

Description

@bdefore

From @bdefore on October 2, 2018 12:48

After updating to the new CRA2, I'm no longer seeing custom properties applied. Not sure if the issue resides in postcss-present-env or react-app-rewire-postcss.

My configuration in react-app-rewired is unchanged from:

  const variables = require('./src/css/variables.json')
  const mediaQueries = require('./src/css/media-queries.json')

  config = rewirePostcss(config, {
    plugins: () => [
      // postcssPresetEnv(/* allow postcss.config.js to configure */)
      postcssPresetEnv({
        stage: 0,
        features: {
          'custom-media-queries': { extensions: mediaQueries },
          'custom-properties': {
            preserve: false,
            variables: variables
          }
        }
      })
    ]
  })

  // with the following line, custom properties works with ^5.3.0 but not ^6.0.8. without this line, using CRA2 built in CSS Modules support, does not work at all (strange?)
  config = rewireCssModules(config, env) 

The relevant deltas in my dependencies are:

    "postcss-preset-env": "^6.0.8" (up from ^5.3.0)
    "react-app-rewire-postcss": "^2.0.0" (up from ^1.0.2)
    "react-scripts": "2.0.3" (up from ^1.1.5)

(I have left react-app-rewired unchanged at ^1.6.2)

Maybe relevant: #4

Copied from original issue: csstools/postcss-preset-env#84

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions