From 3491d51e94de6e2db5572c2c8ba87c48654e5e36 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Wed, 2 Nov 2022 22:11:25 -0400 Subject: [PATCH] reconcile bug fixes from rebasing master and 0.26.2 changes --- packages/cli/src/lifecycles/bundle.js | 4 +--- .../test/cases/build.default.ssr/build.default.ssr.spec.js | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/cli/src/lifecycles/bundle.js b/packages/cli/src/lifecycles/bundle.js index cdcb28834..ab71a0b96 100644 --- a/packages/cli/src/lifecycles/bundle.js +++ b/packages/cli/src/lifecycles/bundle.js @@ -22,7 +22,7 @@ async function optimizeStaticPages(compilation, optimizeResources) { const { scratchDir, outputDir } = compilation.context; return Promise.all(compilation.graph - .filter(page => !page.isSSR || (page.isSSR && page.data.static)) + .filter(page => !page.isSSR || (page.isSSR && page.data.static) || (page.isSSR && compilation.config.prerender)) .map(async (page) => { const { route, outputPath } = page; const html = await fs.promises.readFile(path.join(scratchDir, outputPath), 'utf-8'); @@ -122,8 +122,6 @@ const bundleCompilation = async (compilation) => { return new Promise(async (resolve, reject) => { try { - compilation.graph = compilation.graph.filter(page => !page.isSSR || (page.isSSR && page.data.static) || (page.isSSR && compilation.config.prerender)); - const optimizeResourcePlugins = compilation.config.plugins.filter((plugin) => { return plugin.type === 'resource'; }).map((plugin) => { diff --git a/packages/cli/test/cases/build.default.ssr/build.default.ssr.spec.js b/packages/cli/test/cases/build.default.ssr/build.default.ssr.spec.js index 313ab35ae..155bf389d 100644 --- a/packages/cli/test/cases/build.default.ssr/build.default.ssr.spec.js +++ b/packages/cli/test/cases/build.default.ssr/build.default.ssr.spec.js @@ -30,7 +30,6 @@ import { JSDOM } from 'jsdom'; import path from 'path'; import { getSetupFiles, getOutputTeardownFiles } from '../../../../../test/utils.js'; import request from 'request'; -import { runSmokeTest } from '../../../../../test/smoke-test.js'; import { Runner } from 'gallinago'; import { fileURLToPath, URL } from 'url'; @@ -64,8 +63,6 @@ describe('Build Greenwood With: ', function() { }); }); - runSmokeTest(['public', 'index'], LABEL); - let response = {}; let artistsPageDom; let homePageDom; @@ -147,7 +144,7 @@ describe('Build Greenwood With: ', function() { }); // this is limited by the fact SSR routes have to write to the fs in order to bundle a page on the fly - xit('should not emit a static file', function(done) { + it('should not emit a static file', function(done) { const ssrPageOutput = fs.existsSync(path.join(outputPath, 'public/artists/index.html')); expect(ssrPageOutput).to.be.false;