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

Don't share global options object for calls to PostCSS #152

Closed
wants to merge 1 commit into from
Closed

Don't share global options object for calls to PostCSS #152

wants to merge 1 commit into from

Conversation

mdjzon
Copy link

@mdjzon mdjzon commented Aug 18, 2017

The fields "to" and "from" is set in a global options object for each processed css file. After postcss is finished the chained function that writes the result to disk might get totally different values for "to" and "from" thus writing the css to the wrong file.

I clone the options object using Object.assign to avoid this.

@coveralls
Copy link

coveralls commented Aug 18, 2017

Coverage Status

Coverage remained the same at 95.333% when pulling 484d47d on mdjzon:master into 0ac612c on postcss:master.

@postcss postcss deleted a comment from mdjzon Aug 18, 2017
@RyanZim
Copy link
Collaborator

RyanZim commented Aug 18, 2017

I've personally been suspicious that code might be problematic; I meant to refactor this sometime, but I never got around to it.

I'm not sure this approach is right; I'm thinking we should rename the global config to cliConfig or something like that. We'd then have have rc() actually return a config object without mutating the global cliConfig. If you feel up to trying this, you're welcome to do so. If not, I'll try to do it myself as time allows.

@RyanZim RyanZim added this to the 5.0.0 milestone Feb 6, 2018
RyanZim added a commit that referenced this pull request Feb 6, 2018
RyanZim added a commit that referenced this pull request Feb 6, 2018
@RyanZim RyanZim closed this in 916c9b8 Feb 6, 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.

3 participants