diff --git a/es5-autogenerated/index.js b/es5-autogenerated/index.js index 305dd13..2d635f3 100644 --- a/es5-autogenerated/index.js +++ b/es5-autogenerated/index.js @@ -133,10 +133,8 @@ PrerenderSPAPlugin.prototype.apply = function (compiler) { return mkdirp(path.dirname(processedRoute.outputPath)).then(function () { return new Promise(function (resolve, reject) { compilerFS.writeFile(processedRoute.outputPath, processedRoute.html.trim(), function (err) { - if (err) reject(`[prerender-spa-plugin] Unable to write rendered route to file "${processedRoute.outputPath}" \n ${err}.`); + if (err) reject(`[prerender-spa-plugin] Unable to write rendered route to file "${processedRoute.outputPath}" \n ${err}.`);else resolve(); }); - - resolve(); }); }).catch(function (err) { if (typeof err === 'string') { @@ -153,8 +151,9 @@ PrerenderSPAPlugin.prototype.apply = function (compiler) { done(); }).catch(function (err) { PrerendererInstance.destroy(); - console.error('[prerender-spa-plugin] Unable to prerender all routes!'); - compilation.errors.push(new Error('[prerender-spa-plugin] Unable to prerender all routes!')); + var msg = '[prerender-spa-plugin] Unable to prerender all routes!'; + console.error(msg); + compilation.errors.push(new Error(msg)); done(); }); }; diff --git a/es6/index.js b/es6/index.js index be1c87e..11904d0 100644 --- a/es6/index.js +++ b/es6/index.js @@ -121,9 +121,8 @@ PrerenderSPAPlugin.prototype.apply = function (compiler) { return new Promise((resolve, reject) => { compilerFS.writeFile(processedRoute.outputPath, processedRoute.html.trim(), err => { if (err) reject(`[prerender-spa-plugin] Unable to write rendered route to file "${processedRoute.outputPath}" \n ${err}.`) + else resolve() }) - - resolve() }) }) .catch(err => { @@ -143,9 +142,10 @@ PrerenderSPAPlugin.prototype.apply = function (compiler) { }) .catch(err => { PrerendererInstance.destroy() - console.error('[prerender-spa-plugin] Unable to prerender all routes!'); - compilation.errors.push( new Error( '[prerender-spa-plugin] Unable to prerender all routes!' ) ); - done(); + const msg = '[prerender-spa-plugin] Unable to prerender all routes!' + console.error(msg) + compilation.errors.push(new Error(msg)) + done() }) } diff --git a/package.json b/package.json index 64b6807..b620bb8 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,10 @@ "name": "Joshua Bemenderfer", "email": "tribex10@gmail.com", "url": "https://joshderf.com/" + }, + { + "name": "qkdreyer", + "email": "quentin.dreyer@gmail.com" } ], "repository": "chrisvfritz/prerender-spa-plugin",