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

ast(parser): fix bug with literals #499

Closed
wants to merge 2 commits into from
Closed

Conversation

dhruvdutt
Copy link
Member

@dhruvdutt dhruvdutt commented Jun 8, 2018

What kind of change does this PR introduce?
Bugfix

Did you add tests for your changes?
Yes

Summary
In case of generation of literal nodes, the final string value inside webpack.config.js doesn't yield quotes. This fixes the bug.

Here's a small demo of adding mode before and after the fix:
image

Does this PR introduce a breaking change?
No

Other information

@@ -432,6 +432,7 @@ function addProperty(j, p, key, value, action) {
});
valForNode = objectExp;
} else {
value = `'${value}'`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is incorrect. The reason why your tests are failing on remove is because you haven't double-quoted your strings.

@evenstensberg
Copy link
Member

Add generator needs to be the one to use double quotes, not ast transform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants