Bug 23682: Add ability to manually import EDI invoices as an alternative to automatic...
[koha.git] / gulpfile.js
blob5b8d6e68a2d4c5dac19228c60656eed4be988113
1 /* eslint-env node */
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 sourcemaps = require('gulp-sourcemaps');
9 const autoprefixer = require('gulp-autoprefixer');
10 const args = require('minimist')(process.argv.slice(2));
12 const STAFF_JS_BASE = "koha-tmpl/intranet-tmpl/prog/js";
13 const STAFF_CSS_BASE = "koha-tmpl/intranet-tmpl/prog/css";
14 const OPAC_JS_BASE = "koha-tmpl/opac-tmpl/bootstrap/js";
15 const OPAC_CSS_BASE = "koha-tmpl/opac-tmpl/bootstrap/css";
17 if (args.view == "opac") {
18     var css_base = OPAC_CSS_BASE;
19     var js_base = OPAC_JS_BASE;
20 } else {
21     var css_base = STAFF_CSS_BASE;
22     var js_base = STAFF_JS_BASE;
25 var sassOptions = {
26     errLogToConsole: true,
27     precision: 3
30 // CSS processing for development
31 function css() {
32     return src(css_base + "/src/**/*.scss")
33         .pipe(sourcemaps.init())
34         .pipe(sass(sassOptions).on('error', sass.logError))
35         .pipe(autoprefixer())
36         .pipe(sourcemaps.write('./maps'))
37         .pipe(dest(css_base));
40 // CSS processing for production
41 function build() {
42     return src(css_base + "/src/**/*.scss")
43         .pipe(sass(sassOptions).on('error', sass.logError))
44         .pipe(autoprefixer())
45         .pipe(cssnano({ zindex: false }))
46         .pipe(dest(css_base));
49 exports.build = build;
50 exports.css = css;
51 exports.default = function () {
52     watch(css_base + "/src/**/*.scss", series('css'));