How to share TypeScript code correctly between Aurelia CLI projects?


I’m trying to develop a local Node package written in TypeScript that I can import into multiple Aurelia CLI projects in the same solution.

I’ve created a sample solution at:

which demonstrates my progress so far - the tooling mirrors our development infrastructure (VS 2017 / ASP.NET Core / Aurelia CLI / TypeScript).

The shared exports are compiling correctly in the referencing Aurelia project, and au build is also working with no reported errors, but the files are not being bundled correctly, resulting in lots of 404 errors for individual script files when the application loads.

Basically, I need help trying to get this final step working. I’m not sure exactly how the shared project should be structured and built so that it will be compatible for both TypeScript compilation AND Aurelia bundling.

Open to any suggestions!


Here is a small example based in requirejs.

Take a look at the projects tsconfig path config and the path config inside the aurelia.json file


Great, that’s a different approach from where I started but I like the simplicity of it a lot, thanks for providing this example, it helps a lot.