From 97c03df4ec0e46d9a2de34ba52fc6b1fd6b83340 Mon Sep 17 00:00:00 2001 From: ppokemon <86124405@qq.com> Date: Thu, 23 May 2019 23:23:26 +0800 Subject: [PATCH] fix: Prevent input undefined --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index db48afc..5556893 100755 --- a/index.js +++ b/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]') {