本文整理汇总了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()
})
})
}
示例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));
});
}
示例3: useref
@Task('useref')
useref() {
return gulp.src('app/*.html')
.pipe(useref())
.pipe(gulpIf('*.js', uglify()))
.pipe(gulpIf('*.css', cssnano()))
.pipe(gulp.dest('dist'))
}
示例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'));
});
示例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' }));
});
示例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' }));
});
示例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());
});