From 61ff03c927b37b8c9f2b770c8ca96c39f401e99d Mon Sep 17 00:00:00 2001 From: clydin <19598772+clydin@users.noreply.github.com> Date: Wed, 3 Jan 2018 16:39:15 -0500 Subject: [PATCH] fix(index): copy loader `options` before modifying (#326) --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index c3b03fbc..a4ef3a90 100644 --- a/lib/index.js +++ b/lib/index.js @@ -40,7 +40,7 @@ const SyntaxError = require('./Error') * @return {cb} cb Result */ module.exports = function loader (css, map) { - const options = loaderUtils.getOptions(this) || {} + const options = Object.assign({}, loaderUtils.getOptions(this)) validateOptions(require('./options.json'), options, 'PostCSS Loader') @@ -51,7 +51,7 @@ module.exports = function loader (css, map) { Promise.resolve().then(() => { const length = Object.keys(options) - .filter((option) => { + .filter((option) => { switch (option) { // case 'exec': case 'ident':