You are previewing Developing a gulp edge, Second Edition.
O'Reilly logo
Developing a gulp edge, Second Edition

Book Description

gulp is an open source, extensible, powerful, and efficient file manipulation tool, marketed as a streaming build system, and built on Node.js (Node). This book is aimed at both intermediate and advanced JavaScript developers, and in this second edition we have updated deprecated packages and also added a couple more chapters from the first edition. We have covered how to use gulpfile.babel.js or gulpfile.ts for TypeScript. And we have added a chapter about starting with Gulp 4.0, even though 4.0 is not completely stable and out yet. We have provided you with the tools and instructions to tap into the 4.0 branch so you can really live on the bleeding edge.

Table of Contents

  1. Preface
    1. What is new in this Second Edition?
    2. What is gulp?
    3. Why use gulp?
    4. How this book helps
    5. What you need to know
    6. The book process
    7. The Authors
  2. 1. Introducing gulp
    1. Plugins
    2. Streams
    3. Flow
    4. gulpfriendly
    5. What is a build system?
      1. JavaScript libraries
      2. Front-end abstractions
      3. The front-end developer
      4. Getting productive
      5. CSS preprocessing
      6. Transpilation
      7. Writing modular JavaScript
      8. Optimization
      9. Unit testing
      10. Linting
      11. Things that make our lives easier
    6. Why use gulp?
      1. Easy to learn
      2. Easy to use
      3. Efficient
      4. High quality
  3. 2. Installing gulp
    1. Installing Node.js and npm
    2. Using npm
    3. Getting started
    4. Source control
    5. Your first gulp file
    6. gulpfile + ES2015
    7. gulpfile + TypeScript
  4. 3. Your first gulp project
    1. Basic directory structure
    2. Copying a single file
    3. Copying multiple files
    4. Copying multiple files with different extensions
    5. Copying multiple files from subdirectories
    6. Matching files and directories
    7. Including first-level subdirectories
    8. Including n-level subdirectories
    9. Passing multiple globs
    10. Excluding files
    11. Creating a single master task
    12. Automatically firing tasks when files change with gulp.watch
    13. Summary
  5. 4. gulp in action
    1. The Pizza App: A project overview
    2. Step 1: Setting up the project
    3. Step 2: Copy static files to dist
    4. Step 3: Sass to CSS
    5. Step 4: Introducing Browserify
    6. Step 5: Starting up a development server
    7. Step 6: Adding basic automation
    8. Step 7: Error handling
    9. Step 8: Make it smoother with BrowserSync
    10. Step 8: Minification for production
    11. Step 9: Sourcemaps for development
    12. Step 10: Enjoy the automation
    13. Bonus: taking it a step further with cache busting
    14. Summary
  6. 5. Advanced gulp techniques
    1. Easier loading of plugins
    2. Different environments
    3. Splitting gulpfile tasks into task files
    4. Working with jshint
    5. Faster build times
    6. watchify done right
    7. Working with sass/compass
    8. Slimming down the CSS
    9. Still thirsty...
  7. 6. Writing a plugin
    1. What your plugin should do
    2. A no-op plugin
    3. A real plugin
    4. Naming your plugin
    5. Passing in arguments
    6. Creating the stream
    7. The vinyl File object
    8. Handling unsupported modes
    9. Supporting buffers
    10. Supporting streams
    11. The finished product
    12. Writing tests
    13. Installing the testing framework
    14. Writing assertions
    15. Continuous integration
    16. Code coverage
    17. Summary
  8. 7. Migrating to Gulp 4
    1. Installation
    2. New gulpfile usage
  9. A. Appendix
    1. Useful plugins