aboutsummaryrefslogtreecommitdiffstats
path: root/gulpfile.js
diff options
context:
space:
mode:
authorsdtsui <szehungdanieltsui@gmail.com>2017-08-07 03:09:17 +0800
committersdtsui <szehungdanieltsui@gmail.com>2017-08-07 03:09:17 +0800
commit3f222854e439e0cf94242e32e54d9c36126d94d5 (patch)
tree143ad25e07f1fea320eda875da93bd4057fc1662 /gulpfile.js
parentf7f9f87ef7850ae94595a5366d269d169139c127 (diff)
downloadtangerine-wallet-browser-3f222854e439e0cf94242e32e54d9c36126d94d5.tar
tangerine-wallet-browser-3f222854e439e0cf94242e32e54d9c36126d94d5.tar.gz
tangerine-wallet-browser-3f222854e439e0cf94242e32e54d9c36126d94d5.tar.bz2
tangerine-wallet-browser-3f222854e439e0cf94242e32e54d9c36126d94d5.tar.lz
tangerine-wallet-browser-3f222854e439e0cf94242e32e54d9c36126d94d5.tar.xz
tangerine-wallet-browser-3f222854e439e0cf94242e32e54d9c36126d94d5.tar.zst
tangerine-wallet-browser-3f222854e439e0cf94242e32e54d9c36126d94d5.zip
Migrate from css to scss + autoprefixer
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js28
1 files changed, 26 insertions, 2 deletions
diff --git a/gulpfile.js b/gulpfile.js
index 53de7a7d9..13760a7d0 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -19,6 +19,8 @@ var manifest = require('./app/manifest.json')
var gulpif = require('gulp-if')
var replace = require('gulp-replace')
var mkdirp = require('mkdirp')
+var sass = require('gulp-sass')
+var autoprefixer = require('gulp-autoprefixer')
var disableDebugTools = gutil.env.disableDebugTools
var debug = gutil.env.debug
@@ -189,6 +191,28 @@ jsFiles.forEach((jsFile) => {
gulp.task('dev:js', gulp.parallel(...jsDevStrings))
gulp.task('build:js', gulp.parallel(...jsBuildStrings))
+gulp.task('build:scss', function () {
+ return gulp.src('ui/app/css/index.scss')
+ .pipe(sourcemaps.init())
+ .pipe(sass().on('error', sass.logError))
+ .pipe(sourcemaps.write())
+ .pipe(autoprefixer())
+ .pipe(gulp.dest('ui/app/css/output'));
+});
+gulp.task('watch:scss', function () {
+ return gulp.src('ui/app/css/index.scss')
+ .pipe(watch('ui/app/css/**/*.scss'))
+ .pipe(sourcemaps.init())
+ .pipe(sass().on('error', sass.logError))
+ .pipe(sourcemaps.write())
+ .pipe(autoprefixer())
+ .pipe(gulp.dest('ui/app/css/output'));
+});
+
+gulp.task('copy:watch', function(){
+ gulp.watch(['./app/{_locales,images}/*', './app/scripts/chromereload.js', './app/*.{html,json}'], gulp.series('copy'))
+})
+
// disc bundle analyzer tasks
@@ -215,9 +239,9 @@ gulp.task('zip', gulp.parallel('zip:chrome', 'zip:firefox', 'zip:edge', 'zip:ope
// high level tasks
-gulp.task('dev', gulp.series('dev:js', 'copy', gulp.parallel('copy:watch', 'dev:reload')))
+gulp.task('dev', gulp.series('build:scss', 'dev:js', 'copy', gulp.parallel('watch:scss', 'copy:watch', 'dev:reload')))
-gulp.task('build', gulp.series('clean', gulp.parallel('build:js', 'copy')))
+gulp.task('build', gulp.series('clean', 'build:scss', gulp.parallel('build:js', 'copy')))
gulp.task('dist', gulp.series('build', 'zip'))
// task generators