File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,11 @@ class GithubComponent(rx.Component):
137137 library = " @masenf/hello-react@github:masenf/hello-react"
138138 tag = " Counter"
139139
140+ def add_imports (self ):
141+ return {
142+ " " : [" @masenf/hello-react/dist/style.css" ]
143+ }
144+
140145def github_component_example ():
141146 return GithubComponent.create()
142147```
@@ -151,6 +156,30 @@ Some important notes regarding this approach:
151156* ` prepare ` or ` build ` scripts will NOT be executed. The distribution archive,
152157 directory, or repo must already contain the built javascript files (this is common).
153158
159+ ``` md alert
160+ # Ensure CSS files are exported in ` package.json `
161+
162+ In addition to exporting the module containing the component, any CSS files
163+ intended to be imported by the wrapped component must also be listed in the
164+ ` exports ` key of ` package.json ` .
165+
166+ ``` json
167+ {
168+ // ...,
169+ "exports" : {
170+ "." : {
171+ "import" : " ./dist/index.js" ,
172+ "require" : " ./dist/index.umd.cjs"
173+ },
174+ "./dist/style.css" : {
175+ "import" : " ./dist/style.css" ,
176+ "require" : " ./dist/style.css"
177+ }
178+ },
179+ // ...
180+ }
181+ ```
182+
154183### Import Types
155184
156185Sometimes the component is a default export from the module (meaning it doesn't require curly braces in the import statement).
You can’t perform that action at this time.
0 commit comments