cuth/postcss-pxtorem

Some errors happen when set exclude value to function: Range out of order in character class In regex.

Opened this issue · 1 comments

I am using version "postcss-pxtorem": "^6.0.0" and I'm having the same issue. This is part of my config in postcss.config.js.

  'postcss-pxtorem': {
      rootValue: 37.5,
      propList: ['*'],
      unitPrecision: 5,
      exclude: (file) => {
        const BLACK_LIST = [
          // cause error
          'pages/patient-report/fang' 
        ]
        return BLACK_LIST.some(item => file.indexOf(item) !== -1)
      }
    }

When I execute the plugin, I will get the following errors,I think the error occurs when call the function filePath.match(exclude).

CleanShot 2023-01-13 at 17 46 52

Still not fixed?
I use this way to avoid this error

  'postcss-pxtorem': {
      rootValue: 37.5,
      propList: ['*'],
      unitPrecision: 5,
      exclude: (file) => {
        return file.indexOf('index.html') !== -1 ||   file.indexOf('live') !== -1 
      }
    }