A note on external dependencies
Once you initialize your component, you can install external modules
with npm
, e.g.
npm install classnames --save
Why it should be avoided
Note that any module installed through npm
will be included in the
bundled output of your component. Therefore, only use an external
module if it is absolutly required to prevent bloat in your exported
component.
Alternatives
If you are creating a lot of components that absolutly must require
say, the classnames
package, then you should add classnames
as a
peer dependency to all of your components and have the parent project
that's requiring your module have classnames
as a dependancy.