cuth / postcss-pxtorem

Convert pixel units to rem (root em) units using PostCSS
MIT License
2.02k stars 174 forks source link

All files are excluded when exclude function contains || #61

Open cxy930123 opened 3 years ago

cxy930123 commented 3 years ago

When exclude option is a function and it has operator ||, all files will be ignored.

For example, the following config will ignore all files:

require('postcss-pxtorem')({
    exclude: function exclude(file) {
      return /node_modules/i.test(file) || false;
    }
})

While the following code works properly:

require('postcss-pxtorem')({
    exclude: function exclude(file) {
      return /node_modules/i.test(file);
    }
})