From f5a69c5714345cf0bc4c0771c1baebbe06512eba Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 15 Feb 2023 17:36:57 +0000 Subject: [PATCH] Bug 32978: Replace node-sass with dart-sass 'npm install' fails in ktd on aarch64, giving unsupported architecture error for node-sass. This patch addresses this by replacing node-sass with dart-sass, updating our gulpfile accordingly. Some corrections have been made to SCSS to fix warnings raised during the build process. Signed-off-by: Paul Derscheid Works like a charm. Great work oleonard! Tested on Apple M1, e.g. aarch64. Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi Edit: I removed some useless formatting changes in the gulpfile, and the yarn.lock changes as well. Signed-off-by: Tomas Cohen Arazi --- gulpfile.js | 10 ++-------- .../intranet-tmpl/prog/css/src/_flatpickr_vars.scss | 2 +- package.json | 6 +++--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 87b785de1e..32f7c3f1c0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,8 +10,7 @@ const path = require('path'); const util = require('util'); const stream = require('stream/promises'); -const sass = require("gulp-sass"); -const cssnano = require("gulp-cssnano"); +const sass = require('gulp-sass')(require('sass')); const rtlcss = require('gulp-rtlcss'); const sourcemaps = require('gulp-sourcemaps'); const autoprefixer = require('gulp-autoprefixer'); @@ -37,8 +36,6 @@ if (args.view == "opac") { } var sassOptions = { - errLogToConsole: true, - precision: 3 } // CSS processing for development @@ -64,15 +61,12 @@ function css() { return stream; } - // CSS processing for production function build() { + sassOptions.outputStyle = "compressed"; var stream = src(css_base + "/src/**/*.scss") .pipe(sass(sassOptions).on('error', sass.logError)) .pipe(autoprefixer()) - .pipe(cssnano({ - zindex: false - })) .pipe(dest(css_base)); if( args.view == "opac" ){ diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/_flatpickr_vars.scss b/koha-tmpl/intranet-tmpl/prog/css/src/_flatpickr_vars.scss index 0c0eaffab3..4c69afa103 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/_flatpickr_vars.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/_flatpickr_vars.scss @@ -3,7 +3,7 @@ $slideTime: 400ms; $daySize: 39px !default; -$padding: $daySize / 16; +$padding: calc( $daySize / 16 ); $dayMargin: 2px !default; $daysWidth: $daySize * 7 + $dayMargin * 14 + $padding * 2 + 2; $calendarWidth: $daysWidth; diff --git a/package.json b/package.json index ac7ff7bcd7..7898e125c8 100644 --- a/package.json +++ b/package.json @@ -11,16 +11,16 @@ "gulp": "^4.0.2", "gulp-autoprefixer": "^4.0.0", "gulp-concat-po": "^1.0.0", - "gulp-cssnano": "^2.1.2", "gulp-exec": "^4.0.0", "gulp-rename": "^2.0.0", "gulp-rtlcss": "^1.4.1", - "gulp-sass": "^3.1.0", + "gulp-sass": "^5.1.0", "gulp-sourcemaps": "^2.6.1", "js-yaml": "^3.13.1", "lodash": "^4.17.12", "merge-stream": "^2.0.0", - "minimist": "^1.2.5" + "minimist": "^1.2.5", + "sass": "^1.58.1" }, "scripts": { "build": "node_modules/.bin/gulp build", -- 2.39.5