Skip to content

Commit ed7f688

Browse files
feat(esbuild): exposes minify pure config (#575)
* feat(esbuild): exposes minify pure config * feat: support ssr Co-authored-by: 信鑫-King <[email protected]> * style: format code Co-authored-by: 信鑫-King <[email protected]>
1 parent e6f5625 commit ed7f688

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/plugin-esbuild/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ export default (api: IApi) => {
1919

2020
api.modifyBundleConfig((memo, { type }) => {
2121
if (memo.optimization) {
22-
const target = api.config.esbuild?.target || ['es2015'];
22+
const { target = 'es2015', pure } = api.config.esbuild || {};
2323
const optsMap = {
2424
[BundlerConfigType.csr]: {
25-
target,
2625
minify: true,
26+
target,
27+
pure,
2728
},
2829
[BundlerConfigType.ssr]: {
2930
target: 'node10',
3031
minify: true,
32+
pure,
3133
},
3234
};
3335
const opts = optsMap[type] || optsMap[BundlerConfigType.csr];

0 commit comments

Comments
 (0)