Using Aurelia CLI with Visual Studio - A solution

Here is a git repo containing a modified for Visual Studio, CLI generated Aurelia project with the following settings:

1 Webpack
1 HTTP/1.1
1 Web (Default)
2 Typescript
1 No markup processing
1 No css processing
1 No testing
1 No integration testing
5 No editor options
1 Yes - Create the project structure…
1 Yes - Use Yarn

It is a plain Aurelia ‘web’ project with no bias towards any IDE. I have taken this as a starting point and made the absolute minimum changes required to make it work (as I wanted it to work) in Visual Studio 2017.

So how do I use it?

Well… here is another git repo that has an example Visual Studio generated dotnet core 2.2.0 MVC app with the contents of the earlier repository layered over it.

With this I can now create an MVC project from within Visual Studio and then add to that the Aurelia goodness. In each repo there are only 2 or 3 commits each with a short note of what happened, but it should be as simple as this:

  1. Create an MVC Visual Studio project as usual.
  2. Copy into this project the contents of the Aurelia CLI generated project (https://github.com/constructor/aurelia-wp-ts-noproc-v1.0.0-beta.10)
  3. ‘yarn install’ and ‘au build’.
  4. Create a controller and view to act as a home for the Aurelia app. This view will use the Layout_App.cshtml generated by the Aurelia build (_Layout_App.cshtml.ejs).
  5. CTRL-F5 and browse to the controller to see the Aurelia app.

So what is this for?

So I can get around the issues highlighted here and show it should be possible to use the CLI to modify a template generated by Visual Studio, rather than or as well as generating a template in code, inside the CLI itself.

4 Likes