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

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

Open
ChrisMiaoMiao opened this issue Jan 13, 2023 · 1 comment

Comments

@ChrisMiaoMiao
Copy link

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

@Tommy0121
Copy link

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 
      }
    }

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

No branches or pull requests

2 participants