Description
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch [email protected]
for the project I'm working on.
I was creating a wrapper component around react-querybuilder with a story using storybook.
Due to the webpack configuration, the css was imported just fine in my app but was not included in the story, this was due to the webpack tree-shaking configuration.
Since react-querybuilder package.json
sideEffects
is false
, the side effect css import was removed.
This was discussed at lenght in webpack in webpack/webpack#6571 but to prevent other one to spend to much time debugging this, I think a simple fix for this package would be to indicate that there is side effect in style files as indicated in webpack doc
Here is the diff that solved my problem:
diff --git a/node_modules/react-querybuilder/package.json b/node_modules/react-querybuilder/package.json
index e18f3fd..3bdf9fc 100644
--- a/node_modules/react-querybuilder/package.json
+++ b/node_modules/react-querybuilder/package.json
@@ -63,7 +63,7 @@
"parseSQL",
"transformQuery"
],
- "sideEffects": false,
+ "sideEffects": ["*.css", "*.scss"],
"repository": {
"type": "git",
"url": "https://github.com/react-querybuilder/react-querybuilder.git",
This issue body was partially generated by patch-package.