[no maintenance any more]use javascript to insert css to html head
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
index.js
package.json
scriptCSS.js

README.md

gulp-scriptcss

use javascript to insert css to html head

options

  • main, type: String or Array, which file do you want to add window.__scriptCSS__ function.
  • cssdirs, type: String or Array, cssdirs to find css files
  • specials, type: Object, some files have special conditons

example

var gulp = require('gulp')
  , uglify = require('gulp-uglify')
  , scriptCSS = require('gulp-scriptcss')

gulp
  .src(['js/**/*.js'])
  .pipe(uglify())
  .pipe(scriptCSS({
    main: 'main.js',
    specials: {
      'main.js': [
        'css/main1.css',
        'css/main2.css'
      ]
    },
    cssdirs: 'css'
    // cssdirs: ['css1', 'css2']
  }))
  .pipe(gulp.dest('dist'));

License

MIT