How to use the gulp-insert.prepend function in gulp-insert

To help you get started, we’ve selected a few gulp-insert 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 DefinitelyTyped / DefinitelyTyped / gulp-insert / gulp-insert-tests.ts View on Github external
gulp.task('gulp-insert-tests', () => {
    return gulp.src('*.js')
        .pipe(insert.prepend('/* Inserted using gulp-insert prepend method */\n'))
        .pipe(insert.prepend('\n/* Inserted using gulp-insert append method */'))
        .pipe(insert.wrap(
            '/* Inserted using gulp-insert wrap method */\n',
            '\n/* Inserted using gulp-insert wrap method */'
        ))
        .pipe(insert.transform((contents, file) => {
            var comment = '/* Local file: ' + file.path + ' */\n';
            return comment + contents;
        }))
        .pipe(gulp.dest('gulp-insert'));
});
github IBM-Watson / a11y.js / tasks / dist.js View on Github external
gulp.task('dist--each', function (done) {
    distPaths = distPaths || toDist;
    outPath = outPath || placeDist;

    gulp.src(distPaths)
      .pipe(sourcemap.init())
      .pipe(insert.prepend('!function(){null===window.a11y&&(window.a11y={})}()\n'))
      .pipe(rename({
        extname: '.min.js'
      }))
      .pipe(uglify())
      .pipe(sourcemap.write('./'))
      .pipe(gulp.dest(outPath));
  });
github NeverBounce / chartjs-plugin-empty-overlay / gulpfile.js View on Github external
var task = function() {
    return gulp.src(srcDir + 'plugin.js')
      .pipe(rename(package.name + '.js'))
      .pipe(insert.prepend(header))
      .pipe(streamify(replace('{{ version }}', package.version)))
      .pipe(gulp.dest(outDir))
      .pipe(rename(package.name + '.min.js'))
      .pipe(streamify(uglify({ preserveComments: 'license' })))
      .pipe(gulp.dest(outDir));
  };
github tweenjs / tween.js / gulpfile.js View on Github external
gulp.task('min', function() {
	return gulp.src([
		'src/Tween.js'
	])
	.pipe(uglify())
	.pipe(insert.prepend(header))
	.pipe(rename('tween.min.js'))
	.pipe(gulp.dest('build'));
});
github risq / cratedigger / bower_components / tween.js / gulpfile.js View on Github external
gulp.task('min', function() {
	return gulp.src([
		'src/Tween.js'
	])
	.pipe(uglify())
	.pipe(insert.prepend(header))
	.pipe(rename('tween.min.js'))
	.pipe(gulp.dest('build'));
});
github yahoo / gifshot / gulpfile.js View on Github external
gulp.task('copy', function () {
    return gulp.src('src/gifshot.js')
        .pipe(insert.prepend(licenseText))
        .pipe(gulp.dest('dist'))
        .pipe(gulp.dest('demo/js/dependencies/'));
});
github RickCraig / localmodel / gulpfile.js View on Github external
gulp.task('concat', function() {
  var closureStart = '(function(window) {\n';
  var closureEnd = '\nwindow.LocalModel = LocalModel;\n' +
    'window.LocalSchema = LocalSchema;\nwindow.LocalDocument ' +
    '= LocalDocument;\n\n}(window));';
  var startingComment = '/*!\n * LocalModel\n * Developer: Rick Craig' +
   '\n * https://github.com/RickCraig/localmodel\n*/\n\n';
  return gulp.src(paths.scripts)
    .pipe(replace(/'use strict';\n\n/g, ''))
    .pipe(concat('localmodel.js'))
    .pipe(insert.prepend(closureStart))
    .pipe(insert.prepend(startingComment))
    .pipe(insert.append(closureEnd))
    .pipe(gulp.dest('dist'));
});
github garage11 / ca11 / gulp / tasks / assets.js View on Github external
tasks.templates = function assetsTemplates() {
        let sources = [path.join(settings.BASE_DIR, './components/**/*.vue')]

        return gulp.src(sources)
            .pipe(vueCompiler({
                commonjs: false,
                namespace: 'global.templates',
                pathfilter: ['src', 'components', 'node_modules'],
            }))
            .on('error', notify.onError('Error: <%= error.message %>'))
            .pipe(ifElse(settings.BUILD_OPTIMIZED, () => minifier()))
            .pipe(concat('templates.js'))
            .pipe(insert.prepend('global.templates={};'))
            .pipe(gulp.dest(path.join(settings.BUILD_DIR, 'js')))
            .pipe(size(_extend({title: 'templates'}, settings.SIZE_OPTIONS)))
    }
github salesforce-ux / design-system / scripts / dist.js View on Github external
done => {
      gulp
        .src(['**/*.css', 'scss/index*'], {
          base: distPath(),
          cwd: distPath()
        })
        .pipe(gulpinsert.prepend(`/*! ${DISPLAY_NAME} ${SLDS_VERSION} */\n`))
        .pipe(gulp.dest(distPath()))
        .on('error', done)
        .on('finish', done);
    },
    done => {

gulp-insert

Append or Prepend a string with gulp

MIT
Latest version published 9 years ago

Package Health Score

54 / 100
Full package analysis