react-magic icon indicating copy to clipboard operation
react-magic copied to clipboard

use css-to-object for parsing styles

Open danielberndt opened this issue 7 years ago • 4 comments

css-to-object uses a more elaborate parsing algorithm. For example it deals correctly with semicolons within a url() property.

fixes #158

danielberndt avatar Oct 10 '18 15:10 danielberndt

Deploy preview for react-magic ready!

Built with commit 85d4eaa59f68822ae420056c8e3145fb05f71fa7

https://deploy-preview-159--react-magic.netlify.com

DanBuild avatar Oct 10 '18 15:10 DanBuild

Looks like the build failed... Could you please take a look?

Daniel15 avatar Oct 14 '18 19:10 Daniel15

Okay I fixed the built. I needed to add an empty fs shim. i also had to apply babel to the bundle, since some of the dependencies used es6 which could not be uglified with the ugligy version used in this project.

I should probably also mention, that the size of the bundle has now significantly increased. Because a full css parser is now included. The .min.js files are now ~75KB instead of ~18KB.

danielberndt avatar Oct 15 '18 00:10 danielberndt

Could you please also try shim source-map-support and see if that reduces the bundle size? We don't really need source maps for this use case (ref https://github.com/reworkcss/css/blob/master/lib/stringify/index.js#L30-L32).

Please check where the bundle size increase is coming from and whether everything being added is 100% needed.

Daniel15 avatar Nov 23 '18 06:11 Daniel15