Update aspnet-prerendering to reference baseUrl in domain-task's main module, not domain-task/fetch. Goal is to avoid Webpack having to bundle isomorphic-fetch on server unless you're actually using it.

This commit is contained in:
SteveSandersonMS
2016-12-01 14:32:54 +00:00
parent b8913d29dd
commit dc130adc91
2 changed files with 4 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "aspnet-prerendering",
"version": "2.0.0",
"version": "2.0.1",
"description": "Helpers for server-side rendering of JavaScript applications in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
"main": "index.js",
"scripts": {
@@ -17,7 +17,7 @@
"url": "https://github.com/aspnet/JavaScriptServices.git"
},
"dependencies": {
"domain-task": "^2.0.1"
"domain-task": "^2.0.2"
},
"devDependencies": {
"@types/node": "^6.0.42",

View File

@@ -2,8 +2,7 @@
import * as url from 'url';
import * as path from 'path';
import * as domain from 'domain';
import { run as domainTaskRun } from 'domain-task/main';
import { baseUrl } from 'domain-task/fetch';
import { run as domainTaskRun, baseUrl as domainTaskBaseUrl } from 'domain-task/main';
const defaultTimeoutMilliseconds = 30 * 1000;
@@ -33,7 +32,7 @@ export function createServerRenderer(bootFunc: BootFunc): RenderToStringFunc {
bindPromiseContinuationsToDomain(domainTaskCompletionPromise, domain['active']);
// Make the base URL available to the 'domain-tasks/fetch' helper within this execution context
baseUrl(absoluteRequestUrl);
domainTaskBaseUrl(absoluteRequestUrl);
// Begin rendering, and apply a timeout
const bootFuncPromise = bootFunc(params);