node.jsnpmbitcode-sharingbit-src

How to make bit ignore a dependency file?


We have a current ReactJS project and we build a custom grid, input, error handler, etc for it.
now we start a new project and we want to share our components code between projects. we do some research and find bit platform bitsrc.io so pleasant and good and we actually share some code between our projects with it.
the only problem is bit has a dependency checker for the import statement.
we add most of the dependency to bit lifeCycle but some of them is a config file and we want them to be different in our projects.
can anyone know the way we could ignore config import dependency to the bit?

//make bit ignore this file in dependency checking 
import GeneralConfig from 'Modules/GeneralConfig/GeneralConfig'

Solution

  • Generally speaking, if you ignore a dependency in bit, the component will not be truly reusable. This is becasue other projects may lack a dependency for the component to function.

    To ignore a missing dependency, use the --ignore-missing-dependencies for the bit tag command.

    What I suggest is for you to inject the configuration to the component, rather than having the component depending on the configuration.