Created
October 14, 2014 12:59
-
-
Save redexp/74361d30481751eccb54 to your computer and use it in GitHub Desktop.
Write styles for titanium alloy like normal node js module and this code will convert it to tss. Expects js files will be in `styles-scr` folder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
watch = require('gulp-watch'), | |
plumb = require('gulp-plumber'), | |
replace = require('gulp-replace'), | |
rename = require('gulp-rename'); | |
gulp.task('tss', function () { | |
watch('app/styles-src/*.js') | |
.pipe(plumb()) | |
.pipe(replace(/.*?\{/m, '')) | |
.pipe(replace(/}\s*;/, '')) | |
.pipe(rename({extname: '.tss'})) | |
.pipe(gulp.dest('app/styles/')) | |
; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment