From 77c10b24c5e2d31d86bc4eebbae35563b0f285d7 Mon Sep 17 00:00:00 2001 From: Arunoda Susiripala Date: Sat, 13 Jan 2018 22:36:14 +0530 Subject: [PATCH] Removes the unused renderScript function --- server/render.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/server/render.js b/server/render.js index bc0ae6fa..b635a005 100644 --- a/server/render.js +++ b/server/render.js @@ -7,7 +7,6 @@ import generateETag from 'etag' import fresh from 'fresh' import requireModule from './require' import getConfig from './config' -import resolvePath from './resolve' import { Router } from '../lib/router' import { loadGetInitialProps } from '../lib/utils' import Head, { defaultHead } from '../lib/head' @@ -125,22 +124,6 @@ async function doRender (req, res, pathname, query, { return '' + renderToStaticMarkup(doc) } -export async function renderScript (req, res, page, opts) { - try { - const dist = getConfig(opts.dir).distDir - const path = join(opts.dir, dist, 'bundles', 'pages', page) - const realPath = await resolvePath(path) - await serveStatic(req, res, realPath) - } catch (err) { - if (err.code === 'ENOENT') { - renderScriptError(req, res, page, err, {}, opts) - return - } - - throw err - } -} - export async function renderScriptError (req, res, page, error, customFields, { dev }) { // Asks CDNs and others to not to cache the errored page res.setHeader('Cache-Control', 'no-store, must-revalidate')