How to use gulp-filter - 10 common examples

To help you get started, we’ve selected a few gulp-filter 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 takanakahiko / slack-emoji-meister / tasks / version.js View on Github external
  ], {
    base: './'
    // bump the version number in those files
      type: importance
    // save it back to filesystem
    // commit the changed version number
    .pipe(git.commit('bump package version'))
    // read only one file to get the version number
    // **tag it in the repository**
github KnapsackPro / knapsack-pro-cypress / gulpfile.babel.js View on Github external
function compile() {
  const filterBinFiles = gFilter(
    { restore: true },

  return (
      .js // compile TypeScript to JavaScript
      .pipe(filterBinFiles) // filter a subset of the files
      // make them executable
      // bring back the previously filtered out files
github redfin / react-server / packages / react-server-integration-tests / gulpfile.babel.js View on Github external
gulp.task("compile", () => {
	const jsFilter = filter("**/*.js", {restore:true});

	return gulp.src("src/**")
github willsoto / angular-chartist.js / gulp / tasks / release.js View on Github external
gulp.task('commit-release', function() {
    return gulp.src([
            args: '-A'
        .pipe(git.commit(`chore(release): new ${getImportance()} release`))
github CSSSR / csssr-project-template / tasks / templates.js View on Github external
gulp.task('templates', () => (
		.pipe(plumber({errorHandler: errorHandler(`Error in \'templates\' task`)}))
		.pipe(gulpIf(, inheritance({basedir: 'app'})))
		.pipe(filter(file => /app[\\\/]pages/.test(file.path)))
		.pipe(jade({basedir: 'app', data}))
		.pipe(gulpIf(process.env.PRETTIFY !== false, prettify({
			braceStyle: 'expand',
			indentWithTabs: true,
			indentInnerHtml: true,
			preserveNewlines: true,
			endWithNewline: true,
			wrapLineLength: 120,
			maxPreserveNewlines: 50,
			wrapAttributesIndentSize: 1,
			unformatted: ['use']
		.pipe(gulpIf(process.env.NODE_ENV === 'production', staticHash({
			asset: 'dist',
			exts: ['js', 'css']
github vtex / toolbelt / src / render.js View on Github external
export function buildJS (manifest) {
  const componentsFilter = gfilter(`**/${buildComponentsPath}/**/*.json`, {restore: true})
  const routesFilter = gfilter(`**/${buildRoutesFilePath}`, {restore: true})
  return new Promise((resolve, reject) => {
      presets: [
        path.resolve(nodeModulesPath, 'babel-preset-es2015'),
        path.resolve(nodeModulesPath, 'babel-preset-stage-2'),
        path.resolve(nodeModulesPath, 'babel-preset-react'),
      plugins: [
        [path.resolve(nodeModulesPath, 'babel-plugin-import-rename'), {'(.less|.sass|.scss)$': '.css'}],
        path.resolve(nodeModulesPath, 'babel-plugin-vtex-render-route'),
        path.resolve(nodeModulesPath, 'babel-plugin-transform-es2015-modules-systemjs'),
    .pipe(vtexRender({manifest: manifest}))
github JeffreyWay / laravel-elixir-webpack-official / src / WebpackTask.js View on Github external
gulpTask() {
        const jsFiles = filter(['**/*.js'], {restore: true});
        return (
            .on('error', this.onError())
            .on('error', this.onError())
github kubernetes / dashboard / build / check.js View on Github external
gulp.task('update-license-headers', () => {
  const commonFilter = filter(getLicenseFileFilter('js', 'go', 'scss'), {restore: true});
  const htmlFilter = filter(getLicenseFileFilter('html'), {restore: true});
  const matchRate = 0.9;

          [path.join(conf.paths.src, getLicenseFileFilter('js', 'go', 'scss', 'html'))],
          {base: conf.paths.base})
      .pipe(license(fs.readFileSync('build/assets/license/header.txt', 'utf8'), {}, matchRate))
      .pipe(license(fs.readFileSync('build/assets/license/header_html.txt', 'utf8'), {}, matchRate))
github krux / prescribe / gulpfile.babel.js View on Github external
function build(config) {
  const basename = path.basename(config.output.filename, path.extname(config.output.filename));
  const jsOnly = filter(['**/*.js'], {restore: true});
  const mapOnly = filter(['**/*.map']);

  return () => webpackStream(config)
    .pipe(rename({basename: basename, extname: '.max.js'}))
    .pipe(rename({basename: basename, extname: '.js'}))
    .pipe(uglify({compress: {properties: false}, output: {'quote_keys': true}}))
    .pipe(rename({basename: basename, extname: '.min.js'}))
github thecreation / gulp-starter-kit / tasks / favicons.js View on Github external
appleStartup: true,
          coast: true,
          favicons: true,
          firefox: true,
          opengraph: false,
          twitter: false,
          windows: true,
          yandex: false,
        html: config.favicons.html,
        replace: true,
    .on('error', gutil.log)
    .pipe(replace('{{root}}', '/'))
        title: config.notify.title,
        message: 'Favicons task complete',
        onLast: true,


Filter files in a `vinyl` stream

Latest version published 3 months ago

Package Health Score

72 / 100
Full package analysis

Popular gulp-filter functions