gulp-scriptcss
v1.5.1
Published
use javascript to insert css to html head
Downloads
3
Readme
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