-
Notifications
You must be signed in to change notification settings - Fork 23
Unable to create production build without debugging #150
Comments
Thanks for submitting this. Just to let you know, if you are requiring our files via the built code (not I'm going to double check with @mako-taco but from what I remember we wanted debugging to exist in production as it's lightweight and extremely useful as sometimes you need to debug production if you can't replicate locally. |
@jhorwit2 Thanks for the reply - I see there's a minified bundle too. Good to know.
Does that mean that the minified bundle still contains debugging, even though it's built with the production env variable set? Ideally I'd hope for a setup similar to how react deals with warnings - importing the library contains warnings, setting |
So, you shouldn't be seeing any warnings with production environment set. The only warnings we show by default are the unused registered actions, which the flag removes. I just checked our prod env and don't see them like we do in dev/test. It does contain the debugging so you have the ability to turn it on via setting the global variable FLUX_DEBUG. The debug code itself is a pretty small file w/ no outside dependencies. Are you asking that we remove that in production builds? I'd be open to consider basically mocking the file in prod builds so it's empty (like how react proptypes does nothing in prod) Our original intentions were that you would be able to debug prod easily with the magic settings; however, I can't think of a time in the last year or so that we have used it. |
Setting
process.env.NODE_ENV
to 'production' in an applications webpack config, as referenced in the debug file (amongst others), should create an optimised build without debug messages being shown.However, during the
fluxthis
build process, the webpack config uses the define plugin, and replaces theprocess.env.NODE_ENV
with 'development' if not defined.The resulting
fluxthis
build (which is what is downloaded from npm) therefore contains the code:This means that for applications which make use of
fluxthis
, there is no way to create a production build with debugging turned off.The text was updated successfully, but these errors were encountered: