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

mockGPT.js should not be in production bundle #29

Closed
dalimian opened this issue May 20, 2017 · 5 comments · Fixed by #68
Closed

mockGPT.js should not be in production bundle #29

dalimian opened this issue May 20, 2017 · 5 comments · Fixed by #68

Comments

@dalimian
Copy link

when I do import {Bling as GPT} from "react-gpt"; from my production bundle, I see that mockGPT.js makes it into the bundle, could you please provide a way to import only minimal things needed for production.

@eliseumds
Copy link

Have you tried import { default as GPT } from 'react-gpt/lib/Bling';?

@dalimian
Copy link
Author

Yea, same outcome

jamsea pushed a commit that referenced this issue Sep 19, 2017
Preserve import/export statements so users can take advantage of tree shaking

Fixes #29
jamsea added a commit that referenced this issue Sep 19, 2017
Preserve import/export statements so users can take advantage of tree shaking

Fixes #29
@damusnet
Copy link
Contributor

Hi, with import { Bling } from 'react-gpt';, even with v1.1.1, it looks like mockGPT.js is still present in our production bundle (with Next.js / webpack / UglifyJSPlugin tree shaking enabled). Is there another recommended way to import the library? Am I missing something?

image

Thanks for your help.

@potench
Copy link
Contributor

potench commented Jan 2, 2018

@damusnet I will try to fix this today, looks like createManagerTest is getting imported into the distributed payload.

@damusnet
Copy link
Contributor

damusnet commented Jan 4, 2018

Thank you very much @potench for looking into it and fixing it. Much appreciated :)

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

Successfully merging a pull request may close this issue.

4 participants