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

Is testStateMachine code included in prod builds? #73

Closed
san650 opened this issue Aug 28, 2018 · 2 comments
Closed

Is testStateMachine code included in prod builds? #73

san650 opened this issue Aug 28, 2018 · 2 comments

Comments

@san650
Copy link

san650 commented Aug 28, 2018

Hi,

Thanks for the library, it's awesome!

I've started using the library to model a small state machine for a react app and I believe that when doing a production build of my app, the testStateMachine code is included in it. (I'm using webpack to build my app).

Can this be the case?

If it's not the case, sorry for the confusion. In case this is happening, is there a way to prevent this?

This is just a guess, but I think this happens because ./src/testStateMachine.js is required from ./src/index.js. Maybe this could be change to allow users to import it explicitly in the application code with something like

import testStateMachine from "react-automata/testStateMachine"

making the file optional for users, in my case, I want to include it only in dev/test builds.

Let me know if you would accept a PR for making this happen 😃 .

@MicheleBertoli
Copy link
Owner

Thank you very much for opening this issue, @san650.
I confirm that testStateMachine is included in the bundle, and we are discussing possible solutions in #32.

Let me close this, in favour of the other one, and please feel free to contribute to the discussion.

@san650
Copy link
Author

san650 commented Aug 29, 2018

@MicheleBertoli Thanks for your quick reply! I'll follow the conversation in #32

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

No branches or pull requests

2 participants