From 4274764186dd296878c5e3c55d4251e0a4c2d45c Mon Sep 17 00:00:00 2001 From: Konnor Rogers Date: Sat, 28 Sep 2024 22:56:42 -0400 Subject: [PATCH] Update esbuild.defaults.js.erb --- .../bridgetown-core/commands/esbuild/esbuild.defaults.js.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bridgetown-core/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb b/bridgetown-core/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb index 8f9c31905..b824886cb 100644 --- a/bridgetown-core/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb +++ b/bridgetown-core/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb @@ -318,6 +318,7 @@ module.exports = async (esbuildOptions, ...args) => { if (esbuildOptions.entryPoints) delete esbuildOptions.entryPoints const islands = glob.sync(`./${bridgetownConfig.source}/${bridgetownConfig.islandsDir}/*.{js,js.rb}`).map(item => `./${item}`) + const islandsAsObject = islands.reduce((obj, str) => obj[str] = str, {}) esbuild.context({ bundle: true, @@ -339,7 +340,7 @@ module.exports = async (esbuildOptions, ...args) => { minify: process.argv.includes("--minify"), sourcemap: true, target: "es2020", - entryPoints: [...entryPoints, ...islands], + entryPoints: Array.isArray(entryPoints) ? [...entryPoints, ...islands] : {...entryPoints, ...islandsAsObject}, entryNames: "[dir]/[name].[hash]", outdir: path.join(process.cwd(), `${bridgetownConfig.destination}/_bridgetown/static`), publicPath: "/_bridgetown/static",