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

Fix reference pass error in package config #1149

Conversation

PeachScript
Copy link
Contributor

Type

Bugfix

Tests

All tests are passing

Description

We will get an error config if we loading config multiple times from package.json, because the config is passed by reference.

For example, we use postcss and add a postcss field into package.json like this:

...
"postcss": {
  "plugins": {
    "autoprefixer": {
      "grid": true
    }
  }
}
...

Then the first time in ./src/transforms/postcss.js:L34 we can get a correct config like above.

But if we change some styles, in the second time we will get an error config like this:

"postcss": {
  "plugins": [null, null, null],
  "from": "...",
  "to": "..."
}

All plugins will missing because it has been overwritten in ./src/transforms/postcss.js:L48, then compiling will break.

@devongovett devongovett merged commit a36b912 into parcel-bundler:master May 1, 2018
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

Successfully merging this pull request may close these issues.

2 participants