cli
cli copied to clipboard
Support for a frontend subfolder for ASP.NET Core project
I'm submitting a feature request
- Library Version: 0.31.3
Please tell us about your environment:
-
Operating System: Windows 8.1
-
Node Version: 6.10.0
- NPM Version: 3.10.10
-
Browser: Does not apply
-
Language: all
-
Loader/bundler: all
Current behavior:
Currently, when creating a new Aurelia project using the CLI and using the --here
switch, and selecting the ASP.NET Core option, all files and folders that are created by the CLI are put into the folder from which the command is being run. Well, that makes sense, given the --here
swtich.
-
What is the expected behavior? There should be an option for the ASP.NET Core project option to put the Aurelia-related files and folders into an own Frontend or ClientApp or something like that folder and properly update the aurelia.json file and all related build tasks.
-
What is the motivation / use case for changing the behavior? I personally find it really inconvenient that the frontend files and folders coexist next to my actual .NET project, since they are built with 2 totally different technologies and many of these files and folders (for eg. the generators) are ones that I think most of us only touch on a very rare basis and therefore are kind of disturbing, especially when poking the .NET stuff. I'd prefer the "old-fashion" way of creating a subfolder inside the project folder, for eg. ClientApp (as the .NET SPA templates do) or a Frontend or something like that, and the CLI should update all the path mappings accordingly to be able to properly build the project. I've created a project like this and updated the aurelia.json file and the project does actually compile properly, runs property, the only problem is that the sourcemaps somehow get messed up. What that means is that I am unable to debug my app using VS Code + Debugger for Chrome extension, because VS Code says the source maps are improper and therefore my breakpoints never get hit. Probably I am missing some configuration and the relative paths are wrong, just I don't know what exactly could be wrong and it would be nice to have a ready-made template for such cases which is properly configured.
We always have the Aurelia project separated from the .Net project and move the output to a specific folder for example scripts. So the folder structure looks like this:
-aurelia-app -aspnet --scripts
Add the following gulp task
import * as gulp from 'gulp';
import * as changed from 'gulp-changed';
import * as project from '../aurelia.json';
import * as moment from 'moment';
export default function sp() {
console.log('Time is now ' + moment(Date.now()).format('HH:mm:ss'));
return gulp.src('scripts/**/*', {base:"."})
.pipe(gulp.dest('../youraspNETproject/'));
}
And then add the gulp task to the build.ts file. @magnusdanielson