How to use gulp-less - 10 common examples

To help you get started, we’ve selected a few gulp-less examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github orizens / echoes / gulp / style.js View on Github external
gulp.task('style', () => {
  return gulp.src([
      './src/css/style.less',
      './src/app/**/*.less'
  	])
    .pipe(sourcemaps.init())
    .pipe(less())
    // .pipe(csso())
    .pipe(concat('style.css'))
    .pipe(sourcemaps.write())
    // .pipe(uncss({
    //     html: [ './src/app/**/*.html', './src/index.html' ],
    //     ignore: [ '.active', 'show-description', 'fa-*', 'user-signed-in',
    //               'show-youtube-player', 'fullscreen', 'yt-playing', 
    //               'transition-in', '[drawer-opened]*']
    // }))
    .pipe(gulp.dest('.tmp'));
});
github jiahaog / jiahao.codes / gulpfile.babel.js View on Github external
gulp.task('useref', () => {
    return gulp.src('src/*.html')
        .pipe(useref())
        .pipe(gulpif('*.css', less())) // compile all .css with less() http://stackoverflow.com/questions/27627936/compiling-less-using-gulp-useref-and-gulp-less
        .pipe(gulpif('*.css', autoprefixer({
            browsers: ['last 2 versions'],
            cascade: false
        })))
        .pipe(gulpif('*.css', minifyCss()))
        .pipe(gulp.dest('dist'))
        .pipe(browserSync.reload({
            stream: true
        }));
});
github pulseshift / openui5-gulp-starter-kit / gulpfile.babel.js View on Github external
function ui5AppStylesDist() {
  try {
    const autoprefix = new LessAutoprefix({
      browsers: ['last 2 versions']
    })
    return paths.appStyles.src.length === 0
      ? Promise.resolve()
      : gulp
          .src(paths.appStyles.src, {
            base: SRC
          })
          .pipe(plumber(buildErrorHandler))
          // compile LESS to CSS
          .pipe(
            less({
              plugins: [autoprefix]
            })
          )
          // minify CSS
          .pipe(
            cleanCSS({
              level: 2
            })
          )
          .pipe(gulp.dest(DIST))
  } catch (error) {
    spinner.fail(error)
  }
}
github HaNdTriX / generator-chrome-extension-kickstart / app / templates / tasks / styles.js View on Github external
gulp.task('styles:less', function () {
  return gulp.src('app/styles/*.less')
    .pipe(gulpif(args.sourcemaps, sourcemaps.init()))
    .pipe(less({ paths: ['./app'] }).on('error', function (error) {
      gutil.log(gutil.colors.red('Error (' + error.plugin + '): ' + error.message))
      this.emit('end')
    }))
    .pipe(gulpif(args.production, cleanCSS()))
    .pipe(gulpif(args.sourcemaps, sourcemaps.write()))
    .pipe(gulp.dest(`dist/${args.vendor}/styles`))
    .pipe(gulpif(args.watch, livereload()))
})
github greim / es6-boilerplate / gulpfile-es6.js View on Github external
function bundle() {
          console.log('compiling less %s -> %s', opts.entryPoint, opts.destDir);
          return gulp.src(opts.entryPoint)
          .pipe(less(lessOpts))
          .on('error', cssError)
          .pipe(gulp.dest(opts.destDir))
        }
        /*
github art-software / art-core / packages / art-webpack-miniprogram / src / compiler / compileLess.ts View on Github external
return new Promise((resolve) => {

    vfs.src(path, getSrcOptions())
      .pipe(plumber(handleErros))
      .pipe(gulpLess())
      .pipe(gulpRename({ extname: '.wxss' }))
      .pipe(
        gulpif(
          isProd(),
          gulpCleanCss({}, (details) => {
            console.log(`${chalk.blue('=>')} ${chalk.green('originalSize:')} ${details.name}: ${details.stats.originalSize / 1000}kb`);
            console.log(`${chalk.blue('=>')} ${chalk.green('minifiedSize:')} ${details.name}: ${details.stats.minifiedSize / 1000}kb`);
          })
        )
      )
      .pipe(getDest(vfs))
      .on('end', resolve);
  });
};
github hawkular / hawkular-apm / ui / src / main / scripts / gulpfile.babel.js View on Github external
const gulpLess = function (done) {
  gulp.src(['plugins/**/*.less'])
    .pipe(less())
    .pipe(concat('hawkularapm.css'))
    .pipe(gulp.dest(config.dist))
    .on('end', () => {
    done && done();
});
};
github softindex / uikernel / gulp / styleBundle.js View on Github external
function styleBundle() {
  const copyImg = gulp.src('themes/**/img/**')
    .pipe(gulp.dest('dist/themes'))
    .pipe(gulp.dest('examples/libs/css'));
  const copyLess = gulp.src('themes/base/main.less')
    .pipe(less())
    .pipe(rename('uikernel.css'))
    .pipe(gulp.dest('dist/themes/base'))
    .pipe(gulp.dest('examples/libs/css/base'));
  return merge(copyImg, copyLess);
}
github project-flogo / flogo-web / gulp / tasks / prod / prod.client.less.js View on Github external
gulp.task('prod.client.less', 'Compile less files into css files for production.', () => {
  let dest = path.join(CONFIG.paths.dist.public, 'assets');
  return gulp.src(CONFIG.paths.distLess, {cwd: CONFIG.paths.source.client})
    .pipe(less({paths: CONFIG.paths.lessImports}))
    .pipe(gulp.dest(dest));
});
github madoar / angular-archwizard / gulpfile.babel.js View on Github external
gulp.task('less', ['cleanup'], () => {
  return gulp.src('./src/**/*.less')
    .pipe(less())
    .pipe(gulp.dest('tmp'));
});

gulp-less

Less for Gulp

MIT
Latest version published 3 years ago

Package Health Score

59 / 100
Full package analysis

Popular gulp-less functions