本文整理汇总了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;未经允许,请勿转载。 |
请发表评论