Cloud Defense Logo

Products

Solutions

Company

Book A Live Demo

Top 10 Examples of "gulp-pug in functional component" in JavaScript

Dive into secure and efficient coding practices with our curated list of the top 10 examples showcasing 'gulp-pug' in functional components in JavaScript. Our advanced machine learning engine meticulously scans each line of code, cross-referencing millions of open source libraries to ensure your implementation is not just functional, but also robust and secure. Elevate your React applications to new heights by mastering the art of handling side effects, API calls, and asynchronous operations with confidence and precision.

gulp.task('templates', () => {
	return gulp
		.src(`${PATHS.source.templates.pages}/**/*.pug`)
		.pipe(plumber(getPluginOptions('plumber')))
		.pipe(getData(() => glob
			.sync(`${PATHS.source.data}/**/*.json`)
			.map(parseDataFile)
			.concat({ books, tags })
			.reduce(mergeObjects, {})))
		.pipe(pug(getPluginOptions('pug')))
		.pipe(rename((path) => {
			if (path.basename !== 'index') {
				path.dirname = path.basename; // eslint-disable-line no-param-reassign
				path.basename = 'index'; // eslint-disable-line no-param-reassign
			}
		}))
		.pipe(gulp.dest(PATHS.build.templates));
});
gulp.task('compile-pug', () => {
  return gulp.src(pugPaths.src)
    .pipe(plumber(error => {
      console.log(error);
      this.emit('end');
    }))
    .pipe(data(() => {
      return require(`./data/${argv.l}/_project.json`);
    }))
		.pipe(pug({
      locals: {},
      pretty: true,
    }))
    .pipe(rename({
      basename: 'index',
    }))
    .pipe(gulp.dest(dirs.dest))
    .pipe(browserSync.reload({stream: true}));
});
gulp.task('views:dev', () => {
  gulp.src('./src/browser/views/*.pug')
    .pipe(jade({
      locals: { env: 'dev' }
    }))
    .pipe(gulp.dest('./dev'));
});
gulp.task('build-pug', () => {
  gutil.log('\n\nBuild pug Paths: \n', pugDir, '\n\n');

  var PUG_LOCALS = {
    title: pkg.name,
    description: pkg.description,
    author: pkg.author
  };

  return gulp.src(pugDir)
    .pipe(pug({ locals: PUG_LOCALS }).on('error', onError))
    .pipe(gulp.dest(outputPaths.pug))
    .pipe(connect.reload());
});
gulp.task('pug', ['clean'], () =>
  gulp.src('test/*.pug')
    .pipe(pug())
    .pipe(gulp.dest('.tmp'))
);
gulp.task('buildPug', () => {
  const locals = {
    description: pkg.description,
    author: pkg.author,
    data: {},
  };
  fs.readdirSync(dataPath).filter(file => file.endsWith('.js')).forEach(file => {
    const name = file.slice(0, -3);
    const filePath = path.join(dataPath, file);
    delete require.cache[require.resolve(filePath)];
    locals.data[name] = require(filePath);
  });
  return gulp
    .src(path.join(pugPath, 'index.pug'))
    .pipe(pug({ locals }))
    .pipe(gulp.dest(builtPath))
    .pipe(connect.reload());
});
gulp.task('templates', () => {
	return gulp.src([routes.templates.pug, '!' + routes.templates._pug])
		.pipe(plumber({
			errorHandler: notify.onError({
				title: 'Error: Compiling pug.',
				message: '<%= error.message %>'
			})
		}))
		.pipe(pug())
		.pipe(gulp.dest(routes.files.html))
		.pipe(browserSync.stream())
		.pipe(notify({
			title: 'Pug Compiled succesfully!',
			message: 'Pug task completed.'
		}));
});
gulp.task('pug', () => {
    return gulp.src([srcBase + 'pug/**/*.pug', srcBase + 'pug/**/_*.pug'])
        .pipe(plumber())
        .pipe(pug({
            pretty: true,
            locals: {
                title: 'gl' + options.gl,
            }
        }))
        .pipe(gulp.dest('./public/gl/'));
});
Gulp.task('resources:build:index', () => {
	return Gulp.src('source/web/themes/' + Config.hotel.theme + '/structure.page')
				.pipe(Pug())
				.pipe(Gulp.dest('dist/'))
})
gulp.task('pug-dev', () =>
  gulp.src('./src/pug/pages/**/*.pug')
    .pipe(plumber())
    .pipe(pug({
      pretty: true,
      basedir: './src/pug'
    }))
    .pipe(gulp.dest('./public'))
)

Is your System Free of Underlying Vulnerabilities?
Find Out Now