cssinjs / cssinjs/jss

react-jss depends on all jss plugins even when not using them

Open
#1,539 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.1k
Forks
386
PR merge metrics
No merged PRs in 30d

Description

__Expected behavior:__
Using react-jss should not require bundling all jss plugins used by the `jss-preset-default`.

__Describe the bug:__
When creating a custom JSS instance without any plugins as explained in the Custom Setup instructions (https://cssinjs.org/react-jss?v=v10.7.1#custom-setup) the result of my Webpack build included all of the `jss-preset-default` related plugins.

__Reproduction:__
I have tried to create a stand alone example, but am finding it difficult to create it. Why aren't there good React + Webpack + TS starter generators?

I went back to my code and removed all references to react-jss, and the bundle didn't have any plugins. Then I added in the JssProvider from react-jss and then suddenly the bundle exploded.

__Managing expectations:__
I will try to pin-point where in the react-jss code this problem may be, but wanted to at least post the problem to see if this is a known design issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.