Skip to content

Commit

Permalink
fix(project-template): set baseDir to '.wwwroot' for ASP.NET Core pro…
Browse files Browse the repository at this point in the history
…jects

Add new baseDir property in aurelia.json with default value of '.'.
Override baseDir value to './wwwroot' for ASP.NET Core projects.

Also allows baseDir to be configurable via aurelia.json instead of
having to change the hard-code value in run.js/ts.
  • Loading branch information
chaskim committed Mar 12, 2017
1 parent d6f0ada commit c1e0401
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/commands/new/project-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,11 @@ exports.ProjectTemplate = class {
this.model.cssProcessor.source = path.posix.join(appRoot, '**/*' + this.model.cssProcessor.fileExtension);
this.model.platform.output = this.scripts.calculateRelativePath(this.root);
this.model.platform.index = path.posix.join(this.projectOutput.calculateRelativePath(this.root), "index.html");
this.model.platform.baseDir = '.';

if (this.model.platform.id === 'aspnetcore') {
this.model.platform.baseUrl = this.scripts.calculateRelativePath(this.projectOutput);
this.model.platform.baseDir = './wwwroot';
}

if (this.unitTests.parent) {
Expand Down
2 changes: 1 addition & 1 deletion lib/resources/tasks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let serve = gulp.series(
port: 9000,
logLevel: 'silent',
server: {
baseDir: ['.'],
baseDir: [project.platform.baseDir],
middleware: [historyApiFallback(), function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
Expand Down
2 changes: 1 addition & 1 deletion lib/resources/tasks/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let serve = gulp.series(
port: 9000,
logLevel: 'silent',
server: {
baseDir: ['.'],
baseDir: [project.platform.baseDir],
middleware: [historyApiFallback(), function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
Expand Down

0 comments on commit c1e0401

Please sign in to comment.