How to use gulp-append-prepend - 10 common examples

To help you get started, we’ve selected a few gulp-append-prepend 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 Automattic / vip-go-mu-plugins-built / jetpack / tools / builder / react.js View on Github external
];

	// Source any JS for allowed modules, which will minimize us shipping much
	// more JS that we haven't pointed to in PHP yet.
	// Example output: modules/(shortcodes|widgets)/**/*.js
	const supportedModulesSource = `modules/@(${ supportedModules.join( '|' ) })/**/*.js`;

	// Uglify other JS from _inc and supported modules
	const sources = [ '_inc/*.js', supportedModulesSource, '!modules/**/test-*.js' ];

	// Don't process minified JS in _inc or modules directories
	const sourceNegations = [ '!_inc/*.min.js', '!modules/**/*.min.js' ];
	gulp
		.src( [ ...sources, ...sourceNegations ] )
		.pipe(
			prepend.prependText(
				'/* Do not modify this file directly. It is compiled from other files. */\n'
			)
		)
		.pipe( gulpif( ! is_prod, sourcemaps.init() ) )
		.pipe(
			minify( {
				output: {
					comments: saveLicense,
				},
				noSource: true,
				ext: { min: '.js' },
			} )
		)
		.pipe( rename( { suffix: '.min' } ) )
		.pipe( gulpif( ! is_prod, sourcemaps.write( 'maps' ) ) ) // Put the maps in _inc/build/maps so that we can easily .svnignore
		.pipe( gulp.dest( '_inc/build' ) )
github openemr / openemr / gulpfile.js View on Github external
gulp.task('rtl:style_uni', function () {
    return gulp.src(config.src.styles.style_uni)
        .pipe(gap.prependText('@import "./rtl.scss";\n')) // watch out for this relative path!
        .pipe(sourcemaps.init())
        .pipe(sass().on('error', sass.logError))
        .pipe(prefix('last 1 version'))
        .pipe(gap.prependText(autoGeneratedHeader))
        .pipe(gulpif(!config.dev, csso()))
        .pipe(gulpif(!config.dev, sourcemaps.write()))
        .pipe(rename({ prefix: "rtl_" }))
        .pipe(gulp.dest(config.dest.themes))
        .pipe(gulpif(config.dev && config.build, gulp.dest(config.dest.themes)))
        .pipe(gulpif(config.dev, reload({ stream: true })));
})
github google / myanmar-tools / clients / js / gulpfile.js View on Github external
gulp.task("build-browser-min", function () {
    // Minified browser build
    return typescriptToJavascript()
        .pipe(sourcemaps.init())
        .pipe(preprocess({
            context: { NODEJS: false }
        }))
        .pipe(uglify({
            wrap: "google_myanmar_tools"
        }))
        .pipe(prependText(LICENSE, "\n"))
        .pipe(rename({
            extname: ".min.js"
        }))
        .pipe(sourcemaps.write("."))
        .pipe(gulp.dest("build_browser"));
});
github Automattic / jetpack / tools / builder / react.js View on Github external
];

	// Source any JS for whitelisted modules, which will minimize us shipping much
	// more JS that we haven't pointed to in PHP yet.
	// Example output: modules/(shortcodes|widgets)/**/*.js
	const supportedModulesSource = `modules/@(${ supportedModules.join( '|' ) })/**/*.js`;

	// Uglify other JS from _inc and supported modules
	const sources = [ '_inc/*.js', supportedModulesSource, '!modules/**/test-*.js' ];

	// Don't process minified JS in _inc or modules directories
	const sourceNegations = [ '!_inc/*.min.js', '!modules/**/*.min.js' ];
	gulp
		.src( [ ...sources, ...sourceNegations ] )
		.pipe(
			prepend.prependText(
				'/* Do not modify this file directly. It is compiled from other files. */\n'
			)
		)
		.pipe( gulpif( ! is_prod, sourcemaps.init() ) )
		.pipe(
			minify( {
				output: {
					comments: saveLicense,
				},
				noSource: true,
				ext: { min: '.js' },
			} )
		)
		.pipe( rename( { suffix: '.min' } ) )
		.pipe( gulpif( ! is_prod, sourcemaps.write( 'maps' ) ) ) // Put the maps in _inc/build/maps so that we can easily .svnignore
		.pipe( gulp.dest( '_inc/build' ) )
github Automattic / vip-go-mu-plugins-built / jetpack / tools / builder / sass.js View on Github external
gulp.task( 'sass:instant-search', function ( done ) {
	log( 'Building Instant Search CSS bundle...' );

	return gulp
		.src( './modules/search/instant-search/*.scss' )
		.pipe( sass( { outputStyle: 'compressed' } ) )
		.pipe(
			prepend.prependText( '/* Do not modify this file directly.  It is compiled SASS code. */\n' )
		)
		.pipe( autoprefixer() )
		.pipe( rename( { suffix: '.min' } ) )
		.pipe( gulp.dest( './_inc/build/instant-search' ) )
		.on( 'end', function () {
			log( 'Instant Search CSS finished.' );
			done();
		} );
} );
github Automattic / vip-go-mu-plugins-built / jetpack / tools / builder / sass.js View on Github external
gulp.series( 'sass:packages', function () {
		return (
			gulp
				.src(
					[
						'packages/**/assets/*.css',
						'!packages/**/assets/*min.css',
						'!packages/**/assets/*rtl.css',
					],
					{ base: '.' }
				)
				.pipe(
					prepend.prependText(
						'/*!\n' +
							'* Do not modify this file directly.  It is automatically generated.\n' +
							'*/\n'
					)
				)
				.pipe( autoprefixer() )
				// Build *-rtl.css
				.pipe( rtlcss() )
				.pipe( rename( { suffix: '-rtl' } ) )
				.pipe( gulp.dest( '.' ) )
				// Build *-rtl.min.css
				.pipe( cleanCSS() )
				.pipe( rename( { suffix: '.min' } ) )
				.pipe( gulp.dest( '.' ) )
				// Finished
				.on( 'end', function () {
github WPGlobus / WPGlobus / gulp_modules / task-readme.js View on Github external
replace(/^(.+):/gm, "\n$1:"),

			// Replace heading marks.
			replace(/=== (.+) ===/g, "# $1 #"),
			replace(/== (.+) ==/g, "## $1 ##"),
			replace(/= (.+) =/g, "### $1 ###"),

			// Link the contributors.
			replace(
				"Contributors: tivnetinc, alexgff, tivnet",
				"Contributors: [TIV.NET INC.](https://profiles.wordpress.org/tivnetinc), " +
				"[Alex Gor](https://profiles.wordpress.org/alexgff), " +
				"[Gregory Karpinsky](https://profiles.wordpress.org/tivnet)"),

			// Prepend badges.
			prepend.prependText(badges),
			rename("README.md"),
			dest("."),
			print()
		],
		cb
	);

};
github strogonoff / ngx-draft-js / gulpfile.js View on Github external
gulp.task('vendorDraftJsCss', function () {
  return gulp
    .src([`${draftJsDist}/Draft.css`])
    .pipe(gap.prependText('::ng-deep { '))
    .pipe(gap.prependText('/* This file is automatically generated from Draft.css upstream */'))
    .pipe(gap.prependText('/* Do not edit */'))
    .pipe(gap.appendText(' }'))
    .pipe(compileSass())
    .pipe(rename('draft-js.component.css'))
    .pipe(gulp.dest(`${src}/${lib}`));
});
github creativetimofficial / vue-material-kit / gulpfile.js View on Github external
gulp.task("licenses", async function() {
  // this is to add Creative Tim licenses in the production & dev mode for the minified js
  gulp.src(["dist/js/chunk-vendors*.js", "dist/js/app*.js"], { base: "./" })
  .pipe(gap.prependText(product_copyright_template))
  .pipe(gulp.dest("./", { overwrite: true }));

  // this is to add Creative Tim licenses in the production & dev mode for the minified html
  gulp.src("dist/index.html", { base: "./" })
  .pipe(gap.prependText(product_copyright_template))
  .pipe(gulp.dest("./", { overwrite: true }));

  // this is to add Creative Tim licenses in the production & dev mode for the minified css
  gulp.src(["dist/css/chunk-vendors*.css", "dist/app*.css"], { base: "./" })
  .pipe(gap.prependText(product_copyright_template))
  .pipe(gulp.dest("./", { overwrite: true }));
  return;
});
github OpenCircuits / OpenCircuits / gulpfile.js View on Github external
function testsBuild() {
    // Combine js files and append tests
    return gulp.src(getPaths().map(function(f) { return 'site/public/' + f; })) // Get rid of prepend
      .pipe(concat('tests/index.js'))
      .pipe(gap.prependFile('tests/prepend.js'))
      .pipe(gap.appendText('start();'))
      .pipe(addsrc.append(getTestPaths().map(function (f) { return 'tests/public/' + f; })))
      .pipe(concat('tests/index.js'))
      .pipe(gulp.dest('.'));
}

gulp-append-prepend

Simple Gulp plugin to append/prepend.

MIT
Latest version published 4 years ago

Package Health Score

47 / 100
Full package analysis