You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 1, 2024. It is now read-only.
Going this route allows for far more customization, but do so at your own risk. For the JavaScript in particular, you can exclude specific imports under the main `undernet.js` file to remove any unneeded components.
29
+
Going this route allows for far more customization, but do so at your own risk. For the JavaScript in particular, you can exclude any unneeded component imports under the main `undernet.js` file.
<pclass="has-right-text">Is this article inaccurate? <ahref="https://github.com/geotrev/undernet/tree/master/docs/download.md">Edit this page on Github!</a></p>
Fun fact: this is how the components are showcased in the component docs.
56
56
57
-
## Customizing Component Imports
57
+
###Customizing Component Imports
58
58
59
-
You may not want to include *every single* component in your project. For example, let's say you only need the [Modal](/docs/components/modals) component. You can do this in two ways.
60
-
61
-
### Import Directly from `dist/`
62
-
63
-
Simply import the component you need directly from its file. This works with or without NPM and Webpack.
59
+
You may not want to include *every single* component in your project. For example, let's say you only need the [Modal](/docs/components/modals) component. Simply import the component you need directly from its file at the path `js/dist/components/`.
*NOTE: Some components, such as Modals in the above example, rely on a helper Utils class. If you end up deleting unnecessary components to keep your project clean, remember to keep `utils.js`.*
71
-
72
-
### Tree Shaking
73
-
74
-
If you're using webpack, [tree shaking](https://webpack.js.org/guides/tree-shaking/) is available by default and will allow you to import from the global `Undernet` object and webpack will discard any unused components.
66
+
*NOTE: Some components, such as Modals in the above example, rely on a helper `Utils` class. If you end up deleting unnecessary components to keep your project clean, remember to keep `utils.js`!*
75
67
76
68
<pclass="has-right-text">Is this article inaccurate? <ahref="https://github.com/geotrev/undernet/tree/master/docs/javascript.md">Edit this page on Github!</a></p>
0 commit comments