nwb
nwb copied to clipboard
How do install dependencies ONLY for demo?
How can I set up a component project created w/ nwb
to automatically install npm/yarn dependencies for only the demo?
I'd like to get the material-ui
dependency out of this: https://www.npmjs.com/package/react-flex-rating
Don't want to have people have to manually install the package in order to run the demo...
Put it in your devDependencies
instead.
That could possibly work... Will that work if I decide to make my demo into a hosted GitHub-page?
I think this is what you need...
- Create your app repository using
nwb new ....
- Install dependencies. For example:
yarn add material-ui
- Install devDependencies for non-production:
yarn add --dev nwb
- Build your app
- Bundle your app in a deployable manner:
yarn build
-- your files will be inside thedist/
folder.
If anyone wants just the files and dependencies (no nwb
) just do yarn install --production
. If someone uses your package as a module, this will work as well. On the other hand, if someone is going to use your repo to improve the source and testing and re-building, a regular yarn install
will install everything you need (nwb
included).
Hope that helps.