Open OR13 opened 4 years ago
When using this syntax below in a Create React App, the whole library is being bundled which causes the bundle to be huge.
import { JSONEditor } from '@material-did/common'
To reproduce:
git checkout 28ce2c9fd07ba437a131d65ea08744a3afe3698e
cd packages/app
npm run build
A helpful command to debug this and visualize the bundle by dependency is source-map-explorer:
source-map-explorer build/static/js/*.js --html > ./report.html
Ultimately we want to be able to direct import files with a syntax like this:
import JSONEditor from '@material-did/common/JSONEditor'
or
import JSONEditor from '@material-did/common/lib/JSONEditor'
Need to do what is described here: https://github.com/formium/tsdx/pull/778#issuecomment-672106970 before this gets any bigger....
We made an attempt here: https://github.com/transmute-industries/material-did/pull/3
We need help from someone more experience with rollup / typescript / material-ui.
You can see their approach here: