-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library/multi-component example? #284
Comments
I made my project multi-component by looking at the Semantic UI style... https://github.com/Semantic-Org/Semantic-UI-React/blob/master/src/index.js |
@torinagrippa thanks for the reference. Should help with the bulk export. How did you set up the compiling for multiple components? What do I have to change in the nwb.config file? https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md#build-configuration |
@torinagrippa I'm using Aphrodite for CSS-in-JS and have had difficulties importing font files. Have you all been able to import custom font files to use in the demo page? |
@mklemme Did you have any luck creating your react component library? |
@01taylop I wasn't able to get this project working but am using https://github.com/FormidableLabs/builder-react-component |
Thanks, might use that for the next project. I have found the solution in Configuration.md, you need to set the babel stage to 1 in the nwb.config.js file:
|
Should really add that to the libraries section of the component guide |
Is it possible to create a library import { Component1 } from 'my-component/part1'
import { Component2 } from 'my-component/part2'
import Component3 from 'my-component/part3/Component3 '
import MainComponent from 'my-component' Having everything in a single In they docu they recommend to use "folder" way of import.
Notice that in the above example, we used: import RaisedButton from 'material-ui/RaisedButton'; instead of import {RaisedButton} from 'material-ui'; This will make your build process faster and your build output smaller. For a complete mapping of Material-UI components to import, see /src/index.js inside the Material-UI npm package root directory. |
@TarikHuber did you find a way to do this? So far I am doing Hi @insin, is this use case supported? Or should we copy from the lib folder after building (and update main in package.json) ? |
Hi @semako-kouye , Unfortunately no. I'm also still using the |
This issue is a:
I wanted to create a react component library and saw that the docs mention this is possible, but only offers react-bootstrap as an example, which doesn't have the nwb.config files.
Is there a simple example of how to get this working with multiple components in the src file? What would I have to do with the nwb.config file to get multiple components built for distribution?
The text was updated successfully, but these errors were encountered: