How to streamline your workflow with a single project using Aurelia CLI / ASP.NET Core

I have an ASP.NET Core project that also hosts the CLI Aurelia project using TypeScript / SASS. IDE is Visual Studio 2015.

When a project is created by Visual Studio or MSBuild, the au build is executed in the precompilation task, so when I create or run an ASP.NET Core project from Visual Studio using F5, the Aurelia CLI will build and link assets for the Aurelia application in wwwroot .

This workflow ensures the correct construction of any changes, and also ensures that .NET Core works as a web server, however it is slow for developers, since any changes in the front-end code (HTML, SASS or TS) that need to be performed require a complete recompilation Aurelia application bindings.

Recent changes to the CLI Aurelia (0.25+) have accelerated the assembly of interfaces, which is great, but it is still not optimal.

I cannot use au run --watch because it does not start the .NET Core server.

Iโ€™m looking for guidance on optimizing the developerโ€™s workflow for this configuration - ideally, the F5 defeat should work as it is now, but with the addition of clock activation in Aurelia, so that any changes to view the files will trigger an incremental build in Aurelia, which directly updates the browser.

+5
source share
1 answer

We use au run --watch almost exclusively, but we are still running the application through F5 in VS, as you expected. We donโ€™t care that the start command actually serves the files (if there was a watch flag in the build command, we would use au build --watch ). We start the clock automatically when we first open the project, after which we can manually stop / restart it when we work during the day, using the tasks that we defined in the gulpfile (see below) and the Task Explorer window (so I donโ€™t need to to open the console). That way, I only need to recompile the server side code when I really change the server side code.

We do not have browser settings, so this does not update the browser automatically, but everything is fine with us - I do not think that ctrl + R is a great receiver.

We have "au build --env prod" at the pre-publishing stage to make sure the assembler creates the assembly.

Our gulpfile.js:

 var gulp = require('gulp'); var shell = require('gulp-shell'); gulp.task('build-dev', shell.task(['au build --env dev'])); gulp.task('watch', shell.task(['au run --watch'])); gulp.task('test', shell.task(['au test --watch'])); gulp.task('build-prod', shell.task(['au build --env prod'])); 
+3
source

Source: https://habr.com/ru/post/1265810/


All Articles