Skip to content

Commit ab31fa7

Browse files
committed
Fix(Pack): Cannot use "external" without "bundle"
1 parent 2383e9a commit ab31fa7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/sync-dev-branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v3
1616
- name: Sync dev branches
17-
uses: 1aron/techor@v2.4.6
17+
uses: 1aron/techor@v2.5.6
1818
with:
1919
action: "sync-dev-branches"
2020
env:

packages/pack/src/actions/main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ module.exports = async function action(specifiedEntries: string[], options: any
9898
}
9999
const eachOutdir = eachOptions.outdir || options.outdir
100100

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

136+
// Fixed: Cannot use "external" option with "bundle" option
137+
if (!buildOptions.bundle) {
138+
delete buildOptions.external
139+
}
140+
136141
// if (!eachOptions.bundle && eachOptions.format === 'esm') {
137142
// buildOptions.plugins.push(createFillModuleExtPlugin(options.esmExt))
138143
// }

0 commit comments

Comments
 (0)