Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module's function gets rewritten #3382

Closed
fildahui opened this issue Feb 11, 2020 · 4 comments · Fixed by #3438
Closed

Module's function gets rewritten #3382

fildahui opened this issue Feb 11, 2020 · 4 comments · Fixed by #3438

Comments

@fildahui
Copy link

fildahui commented Feb 11, 2020

I'm creating a react component using fabric-ui-react lib and for some reason a function from fabric modules gets its body rewritten when bundling (and won't work after that). I'm using two plugins rollup-plugin-babel and @rollup/plugin-node-resolve.
Babel plugin has the option exclude: 'node_modules/**' so it's not affecting the dependencies.

This is the function of fabric module:
image

This is the function after bundling with rollup:
image

Expected Behavior

Modules functions shouldn't be changed

Actual Behavior

The function body is rewritten and many lines are stripped out

I noticed that if I manually edit the source module and change this

var _a = getIcon(iconName) || {
        subset: {},
        code: undefined
}, code = _a.code, subset = _a.subset;

to this:

var _a = getIcon(iconName);
_a = _a || {
        subset: {},
        code: undefined
};
var code = _a.code, subset = _a.subset;

The bundled output is correct and the function is not changed.

@fildahui
Copy link
Author

Hi @lukastaegert is there any update on this?

@lukastaegert
Copy link
Member

Did not find time to look into this yet

@lukastaegert
Copy link
Member

Thanks for spotting it, there was indeed a small but nasty bug at the source of it, fix at #3438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants