evanw / evanw/esbuild

Library exports

Open
#3,986 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
40.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

In Webpack, it's possible to use [output.library.export](https://webpack.js.org/configuration/output/#outputlibraryexport) to choose the export of the namespace object that will be exposed as a library. For example, if my file is

```typescript
export function namedExport(): string {
return "namedExport";
}

export default function defaultExport(): string {
return "defaultExport";
}
```

I can add
```
library: {
name: 'MyLibrary',
type: 'var',
export: 'default',
},
```

and my bundle will not include the named export. Is there something similar that can be done in esbuild with the `iife` format?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.