npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-eagle

v2.1.1

Published

Gulp Eagle is based on Laravel Elixir, which provides a clean, fluent API for defining basic Gulp tasks.

Downloads

13

Readme

Gulp Eagle

npm npm license

Introduction

Gulp Eagle is based on Laravel Elixir, which provides a clean, fluent API for defining basic Gulp tasks. I'm sure you'll love it, if you've ever experienced the trouble of defining the gulp task repeatedly.

Install

npm install --save-dev gulp-eagle

Usage

var Eagle = require('gulp-eagle')

Eagle(function (mix) {
    mix
        .sass('./src/**/*.scss', 'css')
        .script('./src/**/*.js, 'js')
})

Run

  • gulp: run all tasks.
  • gulp watch: run all tasks and watching assets for changes.
  • gulp --prod: run all tasks and minify all CSS, JavaScript and image files.

API

sass(src, [output])

The sass method allows you to compile Sass into CSS.

mix.sass('./src/**/*.scss', 'css')

You may also combine multiple Sass files into a single CSS file by specifying a specific file name.

mix.sass('./src/**/*.scss', 'css/app.css')

mix.sass([
  './src/app.scss',
  './src/components/*.scss'
], 'css/app.css')

By default, Gulp will rewrite and optimize any url() calls within your stylesheets. Imagine that we want to compile Sass that includes a relative URL to an image:

body {
    background: url('../image/img01.jpeg')
}

Gulp Eagle will find img01.jpeg, copy it to your dist/assets folder, and then rewrite the url() within your generated stylesheet:

body {
  background: url('/assets/img01.jpeg?v=592f09d1fd605e1c089031cabe6eced6')
}

If you don't need it, you may disable url() rewriting like so:

var Eagle = require('gulp-eagle')

Eagle.config.css.processCssUrls.enabled = false

less(src, [output])

The less method allows you to compile Less into CSS. The usage like the above sass method.

style(src, [output])

If you would just like to process some plain CSS stylesheets, you may use the style method. The usage like the above sass method.

script(src, [output])

The script method allows you to process JavaScript files, which provides automatic source maps, concatenation, and minification.

mix.script('./src/js/*.js', 'js')

If you have multiple JavaScript files that you would like to combine into a single file, you can specify a specific file name.

mix.script('./src/js/*.js', 'js/app.js')

mix.script([
  './src/js/*.js',
  './src/index.js
], 'js/app.js')

babel(src, [output])

The babel method allows you to compile ES6 into ES5. And has the function of the above script method.

mix.babel('./src/js/*.js', 'js')

mix.babel('./src/js/*.js', 'js/app.js')

image(src, [output])

The image method may be used to copy Image files and directories to new locations. And turn on Image compression in production mode automatically.

mix.image('./src/images/**', 'images')

html(src, [output])

The html method will copy html files to new locations.

mix.html('./src/**/*.html')

You can also turn on HTML compression in production mode:

var Eagle = require('gulp-eagle')

Eagle.config.html.compress.enabled = true

copy(src, [output])

The copy method may be used to copy files and directories to new locations

mix.copy('./src/assets/fonts/**', 'assets/fonts')

version(versionPath)

The version method accepts a path(default: config.versionFolder: 'build') relative to the output directory(default: config.buildPath: 'dist'). Execute only in production mode.

mix.version()

browserSync(options)

The browserSync method will automatically refresh your web browser after you make changes to your assets. Which accepts a JavaScript object, See the BrowserSync docs for options. Then, once you run gulp watch you may access your web application using port 3000 (http://localhost:3000) to enjoy browser syncing.

mix.browserSync()

You can set the directory parameter to true, If you want to scan the directory structure.

mix.browserSync({
  server: {
    directory: true
  }
})

rollup(src, [output], [options])

The rollup method supports packaging modules by using RollupJS. And the src parameter must be a single file.

mix.rollup('./test-app/rollup/index.js', 'app.js')

You can set the RollupJS configuration with the options parameter, and you can also customize the configuration by rollup.config.js in the project root directory.

ChangeLog

2.1.0

  • Added rollup(src, [output], [options]) method.

2.0.0

  • Added mix.browserSync(options), mix.version(), mix.babel(src, [output]) methods.
  • Removed mix.browserify(), mix.clean(), mix.*In() methods.