diff options
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/gulpfile.js b/gulpfile.js index cc723704a..f351c2e2f 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 @@ -159,13 +161,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 +172,20 @@ 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'])) +}) + // bundle tasks var jsDevStrings = jsFiles.map(jsFile => `dev:js:${jsFile}`) @@ -214,9 +224,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 @@ -244,7 +254,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')) } } |