-
How can I test a local change to a component in another repo/workspace on my computer, without having to export the component? I know that in the same workspace changes are synced to node_modules (when i compile, or have Something like npm link would be great. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Bit has just the feature - though it is still in beta as there can be scenarios with peerDependencies that need linking that we're still working on ironing out. But for most use cases the following works well. In the authoring workspace (i.e. where your component changes are happening), run This will create symlinks between the node_modules in the authoring workspace, which will be updated when you compile changes, and the node_modules folder in the consuming project. Now your consuming app should contain the compiled component changes without needing to export. NOTE: it's recommended to also run NOTE 2: If at any point you delete the node_modules in either workspace, or run npm/yarn install commands in the consuming workspace, the symlinks will be broken and you'll need to re-run the |
Beta Was this translation helpful? Give feedback.
Bit has just the feature - though it is still in beta as there can be scenarios with peerDependencies that need linking that we're still working on ironing out. But for most use cases the following works well.
In the authoring workspace (i.e. where your component changes are happening), run
bit link --target <full_path_to_consuming_project_root_dir>
.This will create symlinks between the node_modules in the authoring workspace, which will be updated when you compile changes, and the node_modules folder in the consuming project.
Now your consuming app should contain the compiled component changes without needing to export.
NOTE: it's recommended to also run
bit watch
in the authoring works…