aboutsummaryrefslogtreecommitdiffstats
path: root/gulpfile.js
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-10-19 13:58:46 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-19 13:58:46 +0800
commitc8c773d6416f92c520a509a9811d73f68aa00fc0 (patch)
tree495a798eeb4a5272c80d93725f5146a6fbcf85c8 /gulpfile.js
parent5bdee96e73f65a0b369277e9c56b0afe5159e65b (diff)
parentde1da7d1b215ade650fc644adf63384a401dc240 (diff)
downloadtangerine-wallet-browser-c8c773d6416f92c520a509a9811d73f68aa00fc0.tar
tangerine-wallet-browser-c8c773d6416f92c520a509a9811d73f68aa00fc0.tar.gz
tangerine-wallet-browser-c8c773d6416f92c520a509a9811d73f68aa00fc0.tar.bz2
tangerine-wallet-browser-c8c773d6416f92c520a509a9811d73f68aa00fc0.tar.lz
tangerine-wallet-browser-c8c773d6416f92c520a509a9811d73f68aa00fc0.tar.xz
tangerine-wallet-browser-c8c773d6416f92c520a509a9811d73f68aa00fc0.tar.zst
tangerine-wallet-browser-c8c773d6416f92c520a509a9811d73f68aa00fc0.zip
Merge branch 'NewUI-flat' into merge
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js51
1 files changed, 41 insertions, 10 deletions
diff --git a/gulpfile.js b/gulpfile.js
index 9253949c7..96aada130 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -19,10 +19,16 @@ 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 gulpStylelint = require('gulp-stylelint')
+var stylefmt = require('gulp-stylefmt')
+
var disableDebugTools = gutil.env.disableDebugTools
var debug = gutil.env.debug
+
// browser reload
gulp.task('dev:reload', function() {
@@ -159,13 +165,7 @@ gulp.task('lint', function () {
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failAfterError last.
.pipe(eslint.failAfterError())
-});
-
-/*
-gulp.task('default', ['lint'], function () {
- // This will only run if the lint task is successful...
-});
-*/
+})
// build js
@@ -176,6 +176,37 @@ const jsFiles = [
'popup',
]
+// scss compilation and autoprefixing tasks
+
+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() {
+ gulp.watch(['ui/app/css/**/*.scss'], gulp.series(['build:scss']))
+})
+
+gulp.task('lint-scss', function() {
+ return gulp
+ .src('ui/app/css/itcss/**/*.scss')
+ .pipe(gulpStylelint({
+ reporters: [
+ {formatter: 'string', console: true}
+ ],
+ fix: true,
+ }));
+});
+
+gulp.task('fmt-scss', function () {
+ return gulp.src('ui/app/css/itcss/**/*.scss')
+ .pipe(stylefmt())
+ .pipe(gulp.dest('ui/app/css/itcss'));
+});
+
// bundle tasks
var jsDevStrings = jsFiles.map(jsFile => `dev:js:${jsFile}`)
@@ -219,9 +250,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
@@ -249,7 +280,7 @@ function zipTask(target) {
return () => {
return gulp.src(`dist/${target}/**`)
.pipe(zip(`metamask-${target}-${manifest.version}.zip`))
- .pipe(gulp.dest('builds'));
+ .pipe(gulp.dest('builds'))
}
}