Skip to content

Commit

Permalink
Update esbuild.defaults.js.erb (#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
KonnorRogers authored Oct 1, 2024
1 parent 3ec30e2 commit 47a891a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
Expand Down

0 comments on commit 47a891a

Please sign in to comment.