rcs / jsenv-brunch Goto Github PK
View Code? Open in Web Editor NEWAdd support for processing .jsenv files to Brunch (http://brunch.io). Read environment values to compile to JS.
License: MIT License
Add support for processing .jsenv files to Brunch (http://brunch.io). Read environment values to compile to JS.
License: MIT License
In the example you offer with API_URL, I want to do something very similar.
So I expect I can reference this variable in my js files? When I use require('config') which your documentation seems to suggest I can't access anything, have I misunderstood how this is supposed to be use?
I couldn't finish npm install because of jsenv-brunch throwing Permissions Errors. After installing jsenv-brunch and than running npm install
it works.
Error: EPERM: operation not permitted, rename '<pathtoapp>\node_modules\.jsenv-brunch.DELETE\node_modules\coffee-script' -> '<pathtoapp>\node_modules\jsenv-brunch\node_modules\coffee-script'
If you want to load an integer or a boolean from an environment variable you will quickly find that you have a lot of values that look like "3"
or "true"
. It would currently be possible to write some helper functions in your jsenv file and then call those on each variable but it seems like this may be a common task (it is for my team at least) and could possibly be made easier.
A backwards compatible solution could be something like this:
config.jsenv
{
"API_HOST": "http://my.host",
"__ints__": {
"API_VERSION": 3
},
"__bools__": {
"API_ENABLED": true
}
}
when run with API_ENABLED=no brunch build
would compile to:
exports.module = {
"API_HOST": "https://dev.apihost.com",
"API_VERSION": 3,
"API_ENABLED": false
}
I'm in no way married to this approach if someone has a better suggestion. If this is something you think others may be interested in I'm happy to throw a pull request up.
I'm getting this error on npm i jsenv-brunch
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.5.0/bin/node" "/usr/local/bin/npm" "i" "[email protected]"
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
npm ERR! path /Users/fifigyuri/Projects/environet3x/ui/node_modules/jsenv-brunch
npm ERR! code ENOTEMPTY
npm ERR! errno -66
npm ERR! syscall rename
npm ERR! ENOTEMPTY: directory not empty, rename '/Users/fifigyuri/Projects/environet3x/ui/node_modules/jsenv-brunch' -> '/Users/fifigyuri/Projects/environet3x/ui/node_modules/.jsenv-brunch.DELETE'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/fifigyuri/Projects/environet3x/ui/npm-debug.log
The same happens on npm i [email protected]
or npm i git+https://github.com/rcs/jsenv-brunch.git
.
I'm using node v6.5.0 and npm v3.10.3. Thanks for help.
Great package. Can you add a license?
when I run npm install jsenv-brunch I get stuck in an infinite loop that just prints
[email protected] preinstall /Users/DIR_PATH/node_modules/jsenv-brunch
npm install --production --ignore-scripts
Something like dont-wrap unless @config.modules.wrapper
per @paulmillr
See also: brunch/brunch#602
Hello, do you have the detailed document of jsenv-brunch? Looking forward to your reply
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.