gulp-csstojs
v1.0.1
Published
Compiles CSS files into JS that can be loaded on demand via requirejs.
Downloads
2
Readme
gulp-csstojs
Compiler CSS into JavaScript or TypeScript AMD blocks so that they can be "required" and loaded on demand.
Install
Install with npm
$ npm install --save-dev gulp-csstojs
Usage
var gulp = require('gulp'),
csstojs = require('gulp-csstojs');
gulp.task('default', function() {
return gulp.src('src/*.css')
.pipe(csstojs())
.pipe(gulp.dest('dist'));
});
API
csstojs(options)
options.requireLibrary
Type: String
Default: View
The library to require in the define block.
options.methodToCall
Type: String
Default: View.loadStyles
The method to call to load the styles.
options.typeScript
Type: Boolean
Default: false
Determines if the output should be TypeScript rather than JavaScript.
License
MIT © David Zearing