How do I reuse my own modules in distinct projects of mine?


Say I’ve built a module that helps with drawing a schedule widget.
Now I’d like to use that module in one of my apps. Perhaps later I’d like to use my schedule widget in multiple projects.
How do I do that? Is there a better way than copy pasting the same files in every project ?

I guess I could upload my project to but, as of today, I’m not really proud of my Elm skills enough to publish Elm code on the internet for everyone to see.
Also, the case might arise that your module has to stay closed source because your customer is paying for the code and he wants the code to stay closed source.

So, how could I reuse one of my private module in different projects ?

Thanks for your help.

1 Like

Not sure if it’s what you’re looking for, but you might wanna take a look at this

1 Like

Nice, I’m going to have a look and see if it’s possible to add a local repository (a repo that would live only on my local computer) as a dependency. I’ll probably end up creating a private remote repo anyway, but a local directory would be simpler for a start.

In that case, there’s also an option to add another source directory in elm.json

┃ ┗ :scroll:elm.json
┃ ┗ :scroll:elm.json
┃ ┗ :package:ScheduleWidget


"source-directories": [

But a remote repo is always preferable


this works well with a monorepo setup

This approach also works with with git submodules. I’ve used this a few times and it worked really well.


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.