Browse Source
Merge pull request #33 from ppokemon/fix_input_undefined
fix: Prevent undefined `rule.source`
pull/36/head
Dmitry Karpunin
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
index.js
|
|
@ -33,7 +33,7 @@ module.exports = postcss.plugin('postcss-px-to-viewport', function (options) { |
|
|
|
return function (css) { |
|
|
|
css.walkRules(function (rule) { |
|
|
|
// Add exclude option to ignore some files like 'node_modules'
|
|
|
|
var file = rule.source.input.file; |
|
|
|
var file = rule.source && rule.source.input.file; |
|
|
|
|
|
|
|
if (opts.exclude && file) { |
|
|
|
if (Object.prototype.toString.call(opts.exclude) === '[object RegExp]') { |
|
|
|