diff --git a/lib/commands/new/project-template.js b/lib/commands/new/project-template.js index edcc1ac9a..931abc9a5 100644 --- a/lib/commands/new/project-template.js +++ b/lib/commands/new/project-template.js @@ -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) { diff --git a/lib/resources/tasks/run.js b/lib/resources/tasks/run.js index d2ff59379..e9a0eb4ad 100644 --- a/lib/resources/tasks/run.js +++ b/lib/resources/tasks/run.js @@ -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(); diff --git a/lib/resources/tasks/run.ts b/lib/resources/tasks/run.ts index 80c086ea7..1c182a763 100644 --- a/lib/resources/tasks/run.ts +++ b/lib/resources/tasks/run.ts @@ -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();