2

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.

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks this is interesting although does not directly answer my question.
0

Apparently you can just navigate into the package (in the node_modules) and build there, not sure this would work with all packages but it worked with my private packages.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.