本文整理匯總了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());
});