developit / developit/microbundle

Broken build due to mangled dependency props

Open
#819 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
8.1k
Forks
358
PR merge metrics
No merged PRs in 30d

Description

I have some code that imports a named export of a dependency as follows:
```js
import { _fn } from '@x/y';
...
_fn(...); // calling _fn
```

With mangle configured with `"regex": "^_[^_]"`, the default build (`index.js`) transpiles this to:
```js
const z = require('@x/y');
...
z.a(...); // calling _fn???
```

Disabling mangling works as expected:
```js
const z = require('@x/y');
...
z._fn(...); // calling _fn
```

There is a similar problem with the umd build.

Any way around this?

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.