Skip to content

Commit

Permalink
[readme][s]: update reamde about how to use css chunk if you are impo…
Browse files Browse the repository at this point in the history
…rting a component
  • Loading branch information
mariorodeghiero authored Nov 5, 2020
1 parent d0e2738 commit b6c87d9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,20 @@ It would:

Next, you need to update the template to include correct bundles. In `/templates/datapub/snippets/upload_module.html`, edit the file names of the modules.

Note, if you are developing a React app, e.g., custom `datapub` app, you can use the following attributes passed from the `/templates/datapub/snippets/upload_module.html`:
**Note:**

- If you are importing a component from the datapub library, when running `yarn build` will generate two CSS files. Both of these CSS files should be added In `/templates/datapub/snippets/upload_module.html` be able to render external components imported.

e.g.
```
{% resource 'datapub/css/2.13e0d705.chunk.css' %}
{% resource 'datapub/css/main.c6297111.chunk.css' %}
{% resource 'datapub/js/runtime-main.95a62798.js' %}
{% resource 'datapub/js/2.bfcaf294.chunk.js' %}
{% resource 'datapub/js/main.d1dbf6f8.chunk.js' %}
```

- if you are developing a React app, e.g., custom `datapub` app, you can use the following attributes passed from the `/templates/datapub/snippets/upload_module.html`:

```html
<div id="ResourceEditor"
Expand Down

0 comments on commit b6c87d9

Please sign in to comment.