Skip to content

Commit

Permalink
Fix(Pack): Cannot use "external" without "bundle"
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Aug 10, 2023
1 parent 2383e9a commit ab31fa7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sync-dev-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Sync dev branches
uses: 1aron/techor@v2.4.6
uses: 1aron/techor@v2.5.6
with:
action: "sync-dev-branches"
env:
Expand Down
7 changes: 6 additions & 1 deletion packages/pack/src/actions/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module.exports = async function action(specifiedEntries: string[], options: any
}
const eachOutdir = eachOptions.outdir || options.outdir

/**
/**
* Keep original directory output and prevent bundling
* @example $ esbuild entry.js a.js b.js external.j --format=esm --outdir=dist --bundle --external:./a --external:./b
* @example https://esbuild.github.io/try/#YgAwLjE4LjExAGVudHJ5LmpzIGEuanMgYi5qcyBleHRlcm5hbC5qIC0tZm9ybWF0PWVzbSAtLW91dGRpcj1kaXN0IC0tYnVuZGxlIC0tZXh0ZXJuYWw6Li9hIC0tZXh0ZXJuYWw6Li9iAABlbnRyeS5qcwBleHBvcnQgKiBmcm9tICcuL2EnCmV4cG9ydCAqIGZyb20gJy4vYicKZXhwb3J0ICogZnJvbSAnLi9leHRlcm5hbCcAAGEuanMAZXhwb3J0IGNvbnN0IGEgPSAnYScAAGIuanMAZXhwb3J0IGNvbnN0IGIgPSAnYicAAGV4dGVybmFsLmpzAGV4cG9ydCBjb25zdCBleHRlcm5hbCA9ICdleHRlcm5hbCc
Expand Down Expand Up @@ -133,6 +133,11 @@ module.exports = async function action(specifiedEntries: string[], options: any
delete buildOptions.target
}

// Fixed: Cannot use "external" option with "bundle" option
if (!buildOptions.bundle) {
delete buildOptions.external
}

// if (!eachOptions.bundle && eachOptions.format === 'esm') {
// buildOptions.plugins.push(createFillModuleExtPlugin(options.esmExt))
// }
Expand Down

0 comments on commit ab31fa7

Please sign in to comment.