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

Added default value to CssWriter.write map option #135

Merged
merged 2 commits into from
Oct 6, 2020

Conversation

oscarmattsson
Copy link
Contributor

A lot of the examples omit the map parameter for the function in the css option. For example css: css.write('bundle.css'). When using typescript in the rollup config, this displays an error because the map parameter is required.

The write function seems to have a condition for explicit false values of the map parameter and for all other values it runs the else statement. By setting the map default value to true, it should behave exactly as before.

Also updated the typings to reflect this change.

@Conduitry
Copy link
Member

Do we want to swap around the condition inside that method so that it's just if (map) { ... } else { ... }? Yes that would change the behavior in certain situations (i.e., any non-undefined falsy value would now cause sourcemaps to not be generated), but I think the current behavior there is more confusing. (And what's supposed to happen when you explicitly pass a value other than false isn't described in the readme anyway.)

@benmccann
Copy link
Member

that sounds like a reasonable suggestion to me

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@benmccann benmccann merged commit c4e18c3 into sveltejs:master Oct 6, 2020
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.

None yet

3 participants