4
votes

I am creating two ember applications that will have a lot of shared CSS/components/images between the two of them. I am using the latest version of Ember CLI for the two applications and I would like to create an Ember Addon with the Ember CLI to share all these resources.

What would be the best way to do this to share (1) styles, (2) js components, and (3) images. I have the basics working for the first two and I am struggling with how to share the images and have each application consume them and be able to use them.

Any help would be appreciated!

Thanks!

1
How are you consuming the images?givanse
I want the images inside the Shared Addon, and I want the Ember application that consumes the addon to be able to use the images. <img src="assets/images/shared.png" /> But what I can tell, only the app/styles/vendor folders get synced.Primm

1 Answers

0
votes

Maybe the better solution would be to use Git Submodules instead of Shared Addon. This also works for any other shared code.

In this case you would have three repositories: 1) First app, 2) second app, 3) shared code. And you can link the third one to any other repositories as a submodule (think of it as a symlink).

For example, you can link your submodule to /public/shared folder and then use it like /shared/images/image.png, /shared/styles/style.css and so on.