Skip to content

Commit

Permalink
Fix: Make code splitting work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Dec 24, 2023
1 parent 7c0730d commit 5771030
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ async function build() {
const multiplePackages = outdir.length > 1;
const write = !compression || inline;

let splitting = false
if (options.splitting && format == "esm") {
splitting = true;
}

let additionlOptionsForSvelte = {};
if (plugins?.svelte?.plugin) {
additionlOptionsForSvelte = {
Expand All @@ -30,6 +35,7 @@ async function build() {
const esOptions = {
...additionlOptionsForSvelte,
...options,
splitting,
entryPoints,
sourcemap,
bundle: true,
Expand Down

0 comments on commit 5771030

Please sign in to comment.