From 78c9de2e0e091a2c9728f5d2f24c009c4b4599bd Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Sat, 6 Jun 2020 09:05:30 -0700 Subject: [PATCH] Use NODE_ENV when building client bundles --- modules/utils/getScripts.js | 14 ++++++-------- rollup.config.js | 12 +++++------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/modules/utils/getScripts.js b/modules/utils/getScripts.js index 545700a..2c94a04 100644 --- a/modules/utils/getScripts.js +++ b/modules/utils/getScripts.js @@ -5,15 +5,11 @@ import entryManifest from 'entry-manifest'; import { createElement, createScript } from './markup.js'; function getEntryPoint(name, format) { - let entryPoints; - entryManifest.forEach(manifest => { - if (name in manifest) { - entryPoints = manifest[name]; + for (let manifest of entryManifest) { + let bundles = manifest[name]; + if (bundles) { + return bundles.find(b => b.format === format); } - }); - - if (entryPoints) { - return entryPoints.find(e => e.format === format); } return null; @@ -37,6 +33,8 @@ export default function getScripts(entryName, format, globalURLs) { if (!entryPoint) return []; return getGlobalScripts(entryPoint, globalURLs).concat( + // Inline the code for this entry point into the page + // itself instead of using another