1

I've been playing with React.js for a while and I'm starting to build up a small number of my own components.

What is the approved way of packaging them up into something I can import into different projects?

At the moment, I'm cutting and pasting the actual file around, which is clearly bad. In .NET I would create a new .dll and import that. Publishing a npm package doesn't feel right, although I don't know why.

1 Answer 1

1

Create a git repository with your components and reference that repo in your package.json like:

"package-name": "git+ssh://[email protected]/<user>/<repo>.git"
Sign up to request clarification or add additional context in comments.

1 Comment

Interesting. Can I do that to a local git repos?

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.