-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
--globals option #69
Comments
@zindel the process.env.Node_env is a special case. Bundler like webpack and browsify usually replace them inline for dead code elimination |
@thangngoc89 we're replacing |
@zindel then I think this is a reasonable approach |
Is there currently any way to set environment variables through fpack? |
would automatically replacing |
@boyswan not at the moment. What is the use-case for them (except for @bloodyowl I am reluctant to add this functionality in this specific form since it breaks the predictability of the build. I.e. now we only consider the files & command line options as inputs. Adding environment variables will create the third "hidden" input source. Actually, the same question as above: what is the use-case for them? |
I use |
@zindel the use case is often to pass flags (such as NODE_ENV) and environment information (such as API_URL) without having to write a special command for each environment. |
Some modules account for certain global variables to exist at runtime. The most known examples are
global
andprocess
. This option would permit to specify the JavaScript file to populate all the global variables bundle may need. It will be included at very top of the bundle.By default the value included would be:
Thoughts?
The text was updated successfully, but these errors were encountered: