Commit 47ce6ef9 authored by ytsurk's avatar ytsurk Committed by Ivica Puljic
Browse files

Issue #3045550 by pivica, ytsurk: Removal of gulp-sass-glob

parent 4cf401b9
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -142,3 +142,25 @@ function bs_base_bs_update_8006($target_theme_name) {
    }
  }
}

/**
 * Remove node plugins that we do not use.
 */
function bs_base_bs_update_8007($target_theme_name) {
  $themes_info = _bs_base_drupal_theme_list_info();
  if (isset($themes_info[$target_theme_name])) {
    _bs_base_regexp_file($themes_info[$target_theme_name]->subpath . '/package.json', [
      "^.*\"eslint.*\n" => '',
      "^.*\"gulp-cached.*\n" => '',
      "^.*\"gulp-changed.*\n" => '',
      "^.*\"gulp-if.*\n" => '',
      "^.*\"gulp-notify.*\n" => '',
      "^.*\"gulp-sass-glob.*\n" => '',
      "^.*\"gulp-svgstore.*\n" => '',
      "^.*\"gulp-uglify.*\n" => '',
      "^.*\"node-sass-import-once.*\n" => '',
      "^.*\"postcss-scss.*\n" => '',
      "^.*\"pump.*\n" => '',
    ]);
  }
}
+0 −12
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@ gulpPlugins:
    - "css-mqpacker"
    - "del"
    - "postcss-*"
    - "pump"
    - "stylelint"
    - "stylelint-*"
    - "through2"
@@ -64,14 +63,3 @@ processors:
    clearAllMessages: true
    # Don't throw exception on error but continue with gulp tasks.
    throwError: false

# Configuration for error popup.
#onError:
#  title: 'Gulp error in '
#  message: '<%= error.message %>'
#  sound: 'Beep'
# Let's disable errors for now because it seems gulp plumber is making a mess.
# @todo - this needs to be fixed. Either we figure why plumber is making a mess
# (missing compiled files) or we remove it and try to add some other error
# handler helper.
onError: null
+0 −23
Original line number Diff line number Diff line
@@ -18,18 +18,6 @@ module.exports = function (gulp, plugins, options) {
    plugins.mqpacker({sort: true})
  ];

  // Gulp error handler.
  if (options.onError) {
    options.onErrorCallback = function (err) {
      plugins.notify.onError({
        title: options.onError.title + err.plugin,
        message: options.onError.message,
        sound: options.onError.sound
      })(err);
      this.emit('end');
    };
  }

  // Defining gulp tasks.

  // Load theme _functions.scss partial if it exist so we can use them
@@ -57,14 +45,8 @@ module.exports = function (gulp, plugins, options) {
  gulp.task('sass', function () {
    var task = gulp.src(options.sass.src + '/**/*.scss');

    if (options.onError) {
      // Error management in gulp.
      task.pipe(plugins.plumber({errorHandler: options.onErrorCallback}));
    }

    task.pipe(plugins.sassInject(options.sass.injectVariables))
      .pipe(plugins.through.obj(loadFunctions))
      .pipe(plugins.sassGlob())
      .pipe(plugins.sass({
        outputStyle: 'expanded',
        includePaths: options.sass.includePaths
@@ -77,13 +59,8 @@ module.exports = function (gulp, plugins, options) {

  gulp.task('sass:dev', function () {
    var task = gulp.src(options.sass.src + '/**/*.scss', {sourcemaps: true});
    if (options.onError) {
      // Error management in gulp.
      task.pipe(plugins.plumber({errorHandler: options.onErrorCallback}));
    }
    task.pipe(plugins.sassInject(options.sass.injectVariables))
      .pipe(plugins.through.obj(loadFunctions))
      .pipe(plugins.sassGlob())
      .pipe(plugins.sass({
        outputStyle: 'expanded',
        includePaths: options.sass.includePaths,
+0 −11
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ base theme: bs_base
core_version_requirement: ^8.7.7 || ^9

bs_versions:
  bs_base: 8005
  bs_base: 8007

# @todo - Core does not allow for now themes to declare dependencies on modules.
# @see https://www.drupal.org/project/drupal/issues/474684
Loading