angular2-gulp-prerender
Advanced tools
Comparing version 0.6.1 to 0.10.0
"use strict"; | ||
var universal = require('angular2-universal-preview'); | ||
var universal = require('angular2-universal'); | ||
var through = require('through2'); | ||
@@ -13,10 +13,16 @@ var gutil = require('gutil'); | ||
// bootstrap and render component to string | ||
var bootloader = options.bootloader; | ||
if (!options.bootloader) { | ||
var doc = universal.parseDocument(template); | ||
options.document = doc; | ||
options.template = options.template || template; | ||
options.bootloader = options; | ||
var _options = options; | ||
var _template = template; | ||
var _Bootloader = universal.Bootloader; | ||
var bootloader = _options.bootloader; | ||
if (_options.bootloader) { | ||
bootloader = _Bootloader.create(_options.bootloader); | ||
} | ||
bootloader = universal.Bootloader.create(options.bootloader); | ||
else { | ||
var doc = _Bootloader.parseDocument(_template); | ||
_options.document = doc; | ||
_options.template = _options.template || _template; | ||
bootloader = _Bootloader.create(options); | ||
} | ||
bootloader = _Bootloader.create(options.bootloader); | ||
return bootloader.serializeApplication() | ||
@@ -23,0 +29,0 @@ .then(function (html) { |
@@ -5,3 +5,3 @@ { | ||
"typings": "dist/index.d.ts", | ||
"version": "0.6.1", | ||
"version": "0.10.0", | ||
"description": "Prerender your Universal (isomorphic) Angular 2 app", | ||
@@ -31,7 +31,7 @@ "homepage": "https://github.com/angular/universal", | ||
"preboot": "file:../preboot", | ||
"angular2-universal-preview": "file:../universal", | ||
"angular2-universal": "file:../universal", | ||
"rimraf": "^2.5.1", | ||
"angular2": "2.0.0-beta.12", | ||
"angular2": "2.0.0-beta.13", | ||
"rxjs": "~5.0.0-beta.2", | ||
"zone.js": "~0.6.4", | ||
"zone.js": "~0.6.10", | ||
"typescript": "^1.8.9" | ||
@@ -44,4 +44,4 @@ }, | ||
"peerDependencies": { | ||
"angular2-universal-preview": ">=0.85.1" | ||
"angular2-universal": ">=0.90.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import universal = require('angular2-universal-preview'); | ||
import universal = require('angular2-universal'); | ||
import through = require('through2'); | ||
@@ -32,10 +32,15 @@ var gutil = require('gutil'); | ||
// bootstrap and render component to string | ||
var bootloader = options.bootloader; | ||
if (!options.bootloader) { | ||
let doc = universal.parseDocument(template); | ||
options.document = doc; | ||
options.template = options.template || template; | ||
options.bootloader = options; | ||
const _options = options; | ||
const _template = template; | ||
const _Bootloader = universal.Bootloader; | ||
let bootloader = _options.bootloader; | ||
if (_options.bootloader) { | ||
bootloader = _Bootloader.create(_options.bootloader); | ||
} else { | ||
let doc = _Bootloader.parseDocument(_template); | ||
_options.document = doc; | ||
_options.template = _options.template || _template; | ||
bootloader = _Bootloader.create(options); | ||
} | ||
bootloader = universal.Bootloader.create(options.bootloader); | ||
bootloader = _Bootloader.create(options.bootloader); | ||
@@ -42,0 +47,0 @@ return bootloader.serializeApplication() |
Sorry, the diff of this file is not supported yet
258315
35
5685