jedwards1211 / meteor-webpack-react

(DEPRECATED) use jedwards1211/crater instead
https://github.com/jedwards1211/crater
374 stars 75 forks source link

Ability to add environment variables #76

Open rclai opened 8 years ago

rclai commented 8 years ago

For example, be able to have a file that has the MONGO_URL, MONGO_OPLOG_URL which gets prepended to the meteor run command in the scripts.

FYI - these are different from the settings set in settings.json. See here. Yeah.. I know..

AdamBrodzinski commented 8 years ago

one thing we could do to make it easier to add env variables and make it easier for mup is to change the settings directory to something like below. Creating an env script would allow you to add in export MONGO_URL='foo' in the file and the startup script could source it before running Meteor.

renaming the settings file to settings.json would allow you to place a mup.json file in settings/prod/ and mup would pickup the settings.json file (needs that filename).

settings/
 ---devel/
    - settings.json
    - env.sh
 ---test/
    - settings.json
    - env.sh
 ---prod/
    - settings.json
    - env.sh
jedwards1211 commented 8 years ago

This is why I need to make the core webpack-to-meteor stuff a drop-in package as I describe in https://github.com/jedwards1211/meteor-webpack-react/issues/73 ...this isn't really a meteor/webpack specific issue, and I think focusing on providing the ideal app skeleton is unwise, rather than just providing an example app skeleton that's easy to tweak (without it being hard to keep up with bugfixes in the webpack-to-meteor part).

AdamBrodzinski commented 8 years ago

True, I think trying to handle every edge case will make it bloated. A drop in package would be cool.

jedwards1211 commented 8 years ago

Hey guys, I just created a quick and dirty prototype of my drop-in webpack plugins. See https://github.com/jedwards1211/meteor-webpack-react/tree/webpack-meteor-tools and https://github.com/mindfront/webpack-meteor-tools