javascript - How does material-ui implement the introduction of a single component?
黄舟
黄舟 2017-05-31 10:40:08
0
1
590

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 is main in package.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?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
小葫芦

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template