2 /* eslint no-console:"off" */
4 const { dest, series, src, watch } = require('gulp');
6 const sass = require("gulp-sass");
7 const cssnano = require("gulp-cssnano");
8 const rtlcss = require('gulp-rtlcss');
9 const sourcemaps = require('gulp-sourcemaps');
10 const autoprefixer = require('gulp-autoprefixer');
11 const args = require('minimist')(process.argv.slice(2));
12 const rename = require('gulp-rename');
14 const STAFF_JS_BASE = "koha-tmpl/intranet-tmpl/prog/js";
15 const STAFF_CSS_BASE = "koha-tmpl/intranet-tmpl/prog/css";
16 const OPAC_JS_BASE = "koha-tmpl/opac-tmpl/bootstrap/js";
17 const OPAC_CSS_BASE = "koha-tmpl/opac-tmpl/bootstrap/css";
19 if (args.view == "opac") {
20 var css_base = OPAC_CSS_BASE;
21 var js_base = OPAC_JS_BASE;
23 var css_base = STAFF_CSS_BASE;
24 var js_base = STAFF_JS_BASE;
28 errLogToConsole: true,
32 // CSS processing for development
34 return src(css_base + "/src/**/*.scss")
35 .pipe(sourcemaps.init())
36 .pipe(sass(sassOptions).on('error', sass.logError))
38 .pipe(sourcemaps.write('./maps'))
44 })) // Append "-rtl" to the filename.
45 .pipe(dest(css_base));
48 // CSS processing for production
50 return src(css_base + "/src/**/*.scss")
51 .pipe(sass(sassOptions).on('error', sass.logError))
61 })) // Append "-rtl" to the filename.
62 .pipe(dest(css_base));
65 exports.build = build;
67 exports.default = function () {
68 watch(css_base + "/src/**/*.scss", series('css'));