當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript gulp-cssnano.default函數代碼示例

本文整理匯總了TypeScript中gulp-cssnano.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: function

export default async function (env: string, target: string, callback?: Function) {
  await buildBundle(env, target)

  const config = require(`../../config/${env}.json`)
  const cdnPrefix = `https://dn-st.teambition.net/${config.cdnNames[target]}`
  const revall = new RevAll({
    prefix: cdnPrefix,
    dontGlobal: [/\/favicon\.ico$/],
    dontRenameFile: [/\.html$/],
    dontUpdateReference: [/\.html$/],
    dontSearchFile: [/lib.js/, /images/]
  })

  const stream = merge2([
    gulp.src([
      `www/index.html`,
      `www/fonts/**`,
      `www/images/**`
    ]),
    gulp.src([
      `www/js/**`
    ])
      .pipe(stripDebug())
      .pipe(uglify())
      .pipe(greplace('/weixin/dev/signature', '/weixin/signature'))
      .pipe(greplace('/weixin/dev/tpl/message', '/weixin/tpl/message'))
      .pipe(greplace('http://"+window.location.host+"/images/teambition.png', '/images/teambition.png'))
      .pipe(greplace('/weixin/dev/', '/weixin/')),
    gulp.src([
      `www/css/**`
    ]).pipe(cssNano({rebase: false})),
  ])
    .pipe(revall.revision())
    .pipe(gulp.dest(`dist`), callback)

  return new Promise((resolve, reject) => {
    stream.on('end', async function() {
      resolve()
    })
  })
}
開發者ID:jianxc,項目名稱:teambition-mobile-web,代碼行數:41,代碼來源:release.ts

示例2: compileStyles

	/************************************************************
	 * 
	 * 
	 *                       STYLES
	 * 
	 * 
	 ***********************************************************/
	public compileStyles(destPath: string, bundleFilename: string,
		filesInBundle: string[], onCompileDone) {
		var self = this;

		this.terminal.echoArray("Compiling StyleSheets", filesInBundle);
		this.terminal.echoInfo("Output Path Path \"" + destPath + "\"");

		var dateString = new Date().toString();
		var dnaStamp = "/* PackMan DNA | " + dateString + "*/\n";

		var stream: any;
		if (Global.Settings.useSourceMaps) {
			var stream = gulp.src(filesInBundle)
				.pipe(taskSourceMaps.init())
				.pipe(taskSass().on('error', function(error) {
					console.log("SASS Compilation error", error.message);
				}))
				.pipe(taskMinifyCss())
				.pipe(taskConcat(bundleFilename))
				.pipe(taskSourceMaps.write())
				.pipe(taskInsert.prepend(dnaStamp))
				.pipe(gulp.dest(destPath));
		}
					
		stream.on('end', function() {
			onCompileDone();
			self.terminal.echoPrefixedCyan("** Style Build done", path.join(destPath, bundleFilename));
		});
	}
開發者ID:duffman,項目名稱:packman,代碼行數:36,代碼來源:resource.processor.ts

示例3: useref

 @Task('useref')
 useref() {
     return gulp.src('app/*.html')
         .pipe(useref())
         .pipe(gulpIf('*.js', uglify()))
         .pipe(gulpIf('*.css', cssnano()))
         .pipe(gulp.dest('dist'))
 }
開發者ID:pgalias,項目名稱:hexagon,代碼行數:8,代碼來源:gulpclass.ts

示例4: src

task('build:client-styles', ['set-less-variables', 'copy:bower_components'], () => {
	return src('./src/sites/**/*.less')
		.pipe(less())
		.pipe(cssnano({
			safe: true // 高度な圧縮は無効にする (一部デザインが不適切になる場合があるため)
		}))
		.pipe(dest('./built/resources'));
});
開發者ID:armchair-philosophy,項目名稱:Misskey-Web,代碼行數:8,代碼來源:gulpfile.ts

示例5: function

gulp.task('css', function () {
    return gulp.src('src/content/css/*.css')
      .pipe(autoprefixer('last 2 version'))
      .pipe(gulp.dest('dist/content/css'))
      .pipe(rename({ suffix: '.min' }))
      .pipe(cssnano())
      .pipe(gulp.dest('dist/content/css'))
      .pipe(notify({ message: 'Css task complete' }));
});
開發者ID:DeAusten,項目名稱:Authenticator,代碼行數:9,代碼來源:gulpfile.ts

示例6: sass

gulp.task('sass', function () {
    return sass('src/content/scss/*.scss', { style: 'expanded' })
      .pipe(autoprefixer('last 2 version'))
      .pipe(gulp.dest('dist/content/css'))
      .pipe(rename({ suffix: '.min' }))
      .pipe(cssnano())
      .pipe(gulp.dest('dist/content/css'))
      .pipe(notify({ message: 'Sass task complete' }));
});
開發者ID:DeAusten,項目名稱:Authenticator,代碼行數:9,代碼來源:gulpfile.ts

示例7:

export = gulp.task('production:styles', () => {
  return gulp
    .src(paths.sources.styles)
    .pipe(sass())
    .pipe(autoprefixer(config.autoprefixer))
    .pipe(nano(config.nano))
    .pipe(gulp.dest(paths.output.styles))
    .on('error', errors)
    .pipe(browsersync.stream());
});
開發者ID:mogusbi,項目名稱:ts-starter,代碼行數:10,代碼來源:styles.ts


注:本文中的gulp-cssnano.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。