grunt serve -apiHost=-apiPort=1337 - if you haven't preconfigured an API server.grunt serve -api=qa - same as the above, but allows you to specify a preconfigured API server.grunt serve - runs everything locally and assumes you have a local backend environment running.The base set of commands are broken down like this: With it, we're able to load our site, connect to an API server, automatically refresh our browser when files change, and even conveniently verify if our build process works. This is the base command we use for running our environment locally. Our development process centrally focuses on these commands and we've separated this guide along those lines. grunt deploy - optimizing and deploying.grunt test - making sure we're not doing something awful.But, we use Grunt to run three primary commands. We'll walk through what they do, explore new things, and gotchas along the way. It's transformed into Grunt: The Definitive Guide of the build tasks we use at SRC:CLR. This guide is organized a little differently than most. All those tasks above? Yep, those are in our Grunt toolbox. One of the benefits we're seeing on the front-end is in our build process. Our front end code is entirely separate from our back end. If you're not using Grunt, you might find some inspiration!Īt SRC:CLR, our platform is built with a Single Page Application (SPA) architecture. While we'll be focusing on Grunt, many of these tasks are available in those other build tools like Gulp. There are many like it, but Grunt is our tool of choice with its large community of support. Grunt: The JavaScript Task Runner is one of those tools. A lot of that comes from the tedious tasks that can come from optimizing front end development: minifying, concatenating, copying, refreshing, optimizing, uglifying, and gasp testing! But fret not, there's hope! Tools are available that limit (as much as possible) the annoying tasks of development. Let's face it, development work at times can be repetitive, mundane and just flat out not fun. Part 2 covers our testing process, and conclude the series with how we deploy with grunt. This is Part 1 and covers our local development process. It's lengthy, so if you want to skip that, there's a handy gist that goes along with it so you can share in our process. Preface: This is the kind of guide we wish we had when we were starting to learn Grunt.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |