@@ -, +, @@ - "yarn css --view opac" : This should build unminified CSS for the OPAC, including map files in bootstrap/css/maps - "yarn build --view opac" : This should build minified CSS for the OPAC and generate the RTL versions. - "yarn css" : This should build unminified CSS for the staff interface, including map files in prog/css/maps. - "yarn build" : This should build minified CSS for the staff interface, with no creation of RTL versions. --- gulpfile.js | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) --- a/gulpfile.js +++ a/gulpfile.js @@ -42,35 +42,47 @@ var sassOptions = { // CSS processing for development function css() { - return src(css_base + "/src/**/*.scss") + var stream = src(css_base + "/src/**/*.scss") .pipe(sourcemaps.init()) .pipe(sass(sassOptions).on('error', sass.logError)) .pipe(autoprefixer()) - .pipe(sourcemaps.write('./maps')) - .pipe(dest(css_base)) + .pipe(dest(css_base)); - .pipe(rtlcss()) - .pipe(rename({ - suffix: '-rtl' - })) // Append "-rtl" to the filename. + if (args.view == "opac") { + stream = stream + .pipe(rtlcss()) + .pipe(rename({ + suffix: '-rtl' + })) // Append "-rtl" to the filename. + .pipe(dest(css_base)); + } + + stream = stream.pipe(sourcemaps.write('./maps')) .pipe(dest(css_base)); + + return stream; + } // CSS processing for production function build() { - return src(css_base + "/src/**/*.scss") + var stream = src(css_base + "/src/**/*.scss") .pipe(sass(sassOptions).on('error', sass.logError)) .pipe(autoprefixer()) .pipe(cssnano({ zindex: false })) - .pipe(dest(css_base)) + .pipe(dest(css_base)); - .pipe(rtlcss()) + if( args.view == "opac" ){ + stream = stream.pipe(rtlcss()) .pipe(rename({ suffix: '-rtl' })) // Append "-rtl" to the filename. .pipe(dest(css_base)); + } + + return stream; } const poTasks = { --