National Pest Management

    gulp-jspm-assets
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.4 • Public • Published

    gulp-jspm-assets

    NPM version Build Status Dependency Status

    Consume css, images, ... assets from jspm all via a nice stream

    API

    jspmAssets(packageName, glob)

    Returns a new instance of JspmAssetStream

    jspmAssets(config)

    Returns a merged stream of all the assets in the config object Config object:

    {
      "foundation": "path/**/*.asset",
      "bootstrap": "path/**/*.asset"
    }

    JspmAssetStream(options)

    Constructor creates a new file stream matching files in the requested jspm package

    Options

    • packageName: name of an installed jspm package
    • glob: glob required to match files in the jspm package folder

    Usage

    var gulp = require('gulp');
    var jspmAssets = require('gulp-jspm-assets');
    var minify = require('gulp-minify');
     
    gulp.task('assets', function() {
        jspmAssets('prism', 'themes/theme.css')
            .pipe(minify())
            .pipe(gulp.dest('dest'));
    });
     

    Or you can use a glob to match multiple files

    var gulp = require('gulp');
    var jspmAssets = require('gulp-jspm-assets');
     
    gulp.task('images', function() {
        jspmAssets('prism', 'images/**/*.svg')
            .pipe(gulp.dest('dest'));
    });
     

    Use a config object to get assets from multiple jspm packages

    var gulp = require('gulp');
    var jspmAssets = require('gulp-jspm-assets');
     
    gulp.task('sass', function() {
        jspmAssets({
          'bootstrap', 'sass/**/*.scss',
          'foundation', 'sass/**/*.scss'  
        })
        .pipe(watheverTask())
        .pipe(gulp.dest('dest'));
    });

    Or pipe a stream to it to append jspm package assets to it

    var gulp = require('gulp');
    var jspmAssets = require('gulp-jspm-assets');
     
    gulp.task('css', function() {
        gulp.src('app/**/*.css')
          .pipe(jspmAssets('prism', 'css/**/*.css'))
          .pipe(watheverTask())
          .pipe(concat('./build.css'))
          .pipe(gulp.dest('dest'));
    });

    Install

    npm i gulp-jspm-assets

    DownloadsWeekly Downloads

    2

    Version

    1.1.4

    License

    MIT

    Last publish

    Collaborators

    • nickvdyck