gulp-jsfy
transform .css to .js append to <head>
Installation
$ npm install gulp-jsfy
Plugin Usage
gulp= require 'gulp'gulp.task 'default',-> main= require 'main-bower-files' jsfy= require 'gulp-jsfy' concat= require 'gulp-concat' gulp.src .pipe jsfy dataurl:true .pipe concat 'bower_components.js' .pipe gulp.dest 'public_html'
Plugin Options
- dataurl:
false
true
: Replaceurl(relative/URL)
tourl(DATAURI)
- ignoreURL:
false
true
: Don't Replaceurl(URL)
How do transform to .js ?
It's transform .css into <link href="DATAURI">
.js And resolve url()
references.
Becomes css is standalone.
Example
;/*!Animate.css - http://daneden.me/animateLicensed under the MIT license - http://opensource.org/licenses/MIT Copyright (c) 2014 Daniel Eden...*/
gulpfile.coffee
gulp= require 'gulp'jsfy= require 'gulp-jsfy' gulptask 'default'-> gulpsrc 'animate.css' pipe jsfy pipe gulpdest './'
Execute gulp
$ npm install gulp gulp-jsfy coffee-script$ gulp# Finished 'default' after 37 ms
Become animate.css.js
{ var link=document; link; link; link;