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

Remove source-map from browser build #1571

Merged
merged 1 commit into from May 5, 2021
Merged

Conversation

barak007
Copy link
Contributor

@barak007 barak007 commented May 5, 2021

Since path is false in browsers build the source-map package is actually not in use*.

This PR adds "source-map": false to the package.json also added explicit protection for the existence of the source-map API's.
Now if one will want to use postcss in browser and support source maps he will need to include path and source-map packages

This will decreased the bundle size of postcss by ~27% (from 29KB to 21KB)

(*) There is only one feature that I wasn't sure what to do with related to fromJSON. It is using the PreviousMap (no problem there) and PreviousMap uses the source-map package and I wasn't sure how to fallback. It might be a super edge case for browsers.

@ai
Copy link
Member

ai commented May 5, 2021

fromJSON is a rare feature (I think only Parcel i using it).

@ai ai merged commit b158dd5 into postcss:main May 5, 2021
@ai
Copy link
Member

ai commented May 5, 2021

Do you have Twitter account to mention you in release tweet?

@barak007
Copy link
Contributor Author

barak007 commented May 5, 2021

No Twitter. maybe I should open one

@ai
Copy link
Member

ai commented May 5, 2021

Thanks. Released in 8.2.14.

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

2 participants