Skip to content

Commit

Permalink
fix(aspnet): correctly configure base url
Browse files Browse the repository at this point in the history
Fixes #173
  • Loading branch information
EisenbergEffect committed Jul 13, 2016
1 parent c374d18 commit 1086582
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion lib/build/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ exports.Bundle = class {
let bundleMetadata = {};
let includeBundles = shouldIncludeBundleMetadata(bundles, loaderOptions);
let config = Object.assign({}, loaderConfig);
let location = platform.baseUrl || platform.output;

for (let i = 0; i < bundles.length; ++i) {
let currentBundle = bundles[i];
Expand All @@ -207,7 +208,7 @@ exports.Bundle = class {
bundleMetadata[currentBundle.moduleId] = currentBundle.getBundledModuleIds();
}

config.paths[currentBundle.moduleId] = '../' + platform.output + '/' + currentBundle.moduleId;
config.paths[currentBundle.moduleId] = '../' + location + '/' + currentBundle.moduleId;
}

if (includeBundles) {
Expand Down
2 changes: 1 addition & 1 deletion lib/build/bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports.Bundler = class {
this.loaderOptions = project.build.loader;

this.loaderConfig = {
baseUrl: this.loaderOptions.baseUrl || project.paths.root,
baseUrl: project.paths.root,
paths: {},
packages: [],
stubModules: []
Expand Down
10 changes: 5 additions & 5 deletions lib/commands/new/new-application.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"displayName": "Visual Studio Code"
},
"platform": {
"id": "default",
"displayName": "Default"
"id": "web",
"displayName": "Web"
}
}
},
Expand Down Expand Up @@ -99,11 +99,11 @@
"stateProperty": "platform",
"options": [
{
"displayName": "Default",
"displayName": "Web",
"description": "The default web platform setup.",
"value": {
"id": "default",
"displayName": "Default"
"id": "web",
"displayName": "Web"
}
},
{
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions lib/commands/new/project-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ exports.ProjectTemplate = class {
this.model.cssProcessor.source = path.join(appRoot, '**/*' + this.model.cssProcessor.fileExtension);
this.model.platform.output = scriptsLocation;

if (this.model.platform.id === 'aspnetcore') {
this.model.platform.baseUrl = this.scripts.calculateRelativePath(this.scripts.parent)
}

if (this.unitTests.parent) {
this.model.unitTestRunner.source = path.join(
this.unitTests.calculateRelativePath(this.projectFolder.parent),
Expand Down

0 comments on commit 1086582

Please sign in to comment.