1

I have a javascript project consisting of two js-files

  • component.js
  • component.angular.js

component.js contains the actual logic exported to globals, amd or whatever. It can be used as-is if you are not using angular. component.angular.js wraps the the logic in an angular directive, but requires the logic from component.js.

I would like to register/publish both a non-angular (only need component.js) and a angular (need both component.js and component.angular.js) version of this component in Bower.

Overall question: How to do that?

Questions that might help you figure out why I am confused:

  • Can you even state that two js-files needs to be used in a bower.json?
  • I guess registering the repository where the code lives in Bower, it will look for a bower.json file. But I guess I cannot state in a bower.json that you will need both files in case of angular and only one of them in case of non-angular.
  • Can I have two different bower.json files in the same repository? And register them under two different names in Bower - e.g. under "mycomponent" and "mycomponent-angular".
  • Do I need two repositories?

1 Answer 1

1

Well, I ended up having two repostories. One for sharing the raw component (on bower, npm and meteor) and one for sharing the angular wrapping depending on the raw component (also on bower, npm and meteor).

Do not know if that is the best way, but it works for me.

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

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.