Join Ray Villalobos for an in-depth discussion in this video Setting up environment variables, part of Web Project Workflows with Gulp.js, Git, and Browserify.
- View Offline
…So far we have a good approach for…dealing with our projects while we're developing them.…But our files are really not optimized for a production server.…So, how do we get gulp to be flexible and work in two different environments?…I'm going to show you how to do this with a concept called environment variables.…An environment variable is something you can set as part of…your computer's processes that can affect the way an application works.…Now when the application runs, it can check the value of one of these variables.…They're sort of like PHP server variables.…Node.js provides a special way of accessing these type of environment…variables through your application, by a process called proecess.env.…
So within our application, we can actually check for this, by adding a variable.…So we'll create something called env.…We'll go ahead and set it to use this process.env that note provides.…And check to see if we've set up a NODE.ENV variable.…This is the environment variable.…And then push that value into this ENV variable.…
- Why workflow management?
- Processing tasks with gulp-coffee
- Importing libraries with Browserify
- Processing Sass and Compass
- Issuing tasks in sequence
- Watching changes to files
- Adding static reloads
- Setting up environment variables
- Minifying HTML
- Compressing images