Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others


0 votes
in Technique[技术] by (71.8m points)

javascript - How to install gulp-sass-glob

When I am trying to save scss files which are imported to main sccs file - every time I need resave main scss file to apply changes. therefore I have decided to install gulp-sass-glob according to this https://www.npmjs.com/package/gulp-sass-glob but unfortunately it does not work.

Here is my code, please help me how to integrate gulp-sass-glob in my gulp file or what is wrong here. Thank you.

const { src, dest, parallel, series, watch } = require('gulp');

// Load plugins
const sass = require('gulp-sass');
const browsersync = require('browser-sync').create();
const htmlmin = require('gulp-htmlmin');

// Directories
const SRC = './src/';
const DEST = './dist/';
const DEST_CSS = `${DEST}css/`;
const SRC_CSS = `${SRC}scss/*main.scss`;

var gulp = require('gulp');
var sassGlob = require('gulp-sass-glob');

gulp.task('styles', function () {
    return gulp

// Watch files
function watchFiles() {
  watch(`${SRC_CSS}*`, css);
  watch(`${SRC}lang`, html);
// BrowserSync
function browserSync() {
    server: {
      baseDir: DEST
    port: PORT

// Tasks to define the execution of the functions simultaneously or in series
exports.watch = series(
  parallel( css, html, copyStaticHTML, watchFiles, browserSync)
exports.default = series(clear, parallel(js, css, html,  copyStaticHTML));

Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share