Material-ui can directly introduce the entire library, but sometimes only the required components, such as AppBar, are introduced in order to reduce the size of js.
import AppBar from 'material-ui/AppBar';
In this way, only the AppBar component will be introduced, and the entire material-ui will not be introduced, thus reducing the size of the packaged js.
My question ismain
inpackage.json
specifies the entry file for each package. In this case, how is the introduction of a single component implemented, that is,material -How is the bar in ui/AppBar
implemented?
In fact, by default, you first go to the root directory
node_modules/material-ui/AppBar
You will know after you go to
node_modules/material-ui
and take a look