I have a private npm package (that is in a private registry as well), I have been considering different options for testing. Since the package, only runs within applications, I cannot simply test locally. Although, I would prefer not to test by publishing on each change and updating a new version only to find out that I have a new bug.
One idea I had was make changes in the package code which is in the node_modules on one of my apps that use an older version, then re-build the package inside the node modules test it and see if works as expected, if it does then I would publish the updated version of the package for all my apps. Is this possible?
Note: I cannot really make changes to the dist folder which is used since once built it is unrecognizable and not really workable even if technically possible.
Add a comment
|
2 Answers
If you want to test your own package, you can include it in the dependencies in the package.json file, like these -
{
},
"dependencies": {
"mymodule": "file:../MYMODULE",
"mypackage": "file:../MYPACKAGE"
},
}
You should mention the path here, if its located in the same folder as your existing project, you can use the path as i have shown in the example.
1 Comment
Michael
Thanks this is interesting although does not directly answer my question.