本文整理匯總了TypeScript中gulp-sass類的典型用法代碼示例。如果您正苦於以下問題:TypeScript gulp-sass類的具體用法?TypeScript gulp-sass怎麽用?TypeScript gulp-sass使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了gulp-sass類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
gulp.task('css.build', () =>
gulp.src(PATH.src.css)
.pipe(sass().on('error', sass.logError))
.pipe(autoPrefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest(PATH.dest.app.client))
示例2:
export = () => {
gulp.src(Config.src.scss)
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(cssmin())
.pipe(sourcemaps.write())
.pipe(gulp.dest(Config.dist.dev));
};
示例3: buildStyles
export default function buildStyles() {
return gulp.src(project.paths.styles)
.pipe(changed(project.paths.output, {extension: '.css'}))
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest(project.paths.output));
};
示例4:
export = () => {
return gulp.src([APP_SRC + '/**/*.scss', '!' + APP_SRC + '/styles/**/_assets.scss'])
// .pipe(sassLint())
// .pipe(sassLint.format())
// .pipe(sassLint.failOnError())
.pipe(sass())
.pipe(gulp.dest(APP_SRC + '/'));
};
示例5:
gulp.task("sass", () => {
gulp.src(Paths.StylesSrc)
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(cleanCss())
.pipe(sourcemaps.write())
.pipe(gulp.dest(Paths.StylesDist))
.pipe(connect.reload());
});
示例6:
gulp.task(task, () => {
let result = gulp
.src(path.join(root, project.plugin.src, '**/*.{scss,css}'))
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(sourcemaps.write());
for (const moduleName in project.plugin.outputs) {
result = result
.pipe(gulp.dest(path.join(project.plugin.output, moduleName)));
}
return result;
});
示例7: processCSS
export default function processCSS() {
let processors = [
autoprefixer({browsers: ['last 1 version']}),
cssnano
];
return gulp.src(project.cssProcessor.source)
.pipe(changedInPlace({firstPass:true}))
.pipe(sourcemaps.init())
.pipe(postcss(processors))
.pipe(sass().on('error', sass.logError))
.pipe(build.bundle());
};
示例8:
gulp.task("build.css", ["build.css.dev"], (done: any) => {
return gulp.src(["src/themes/*.scss"])
.pipe(sourcemaps.init())
.pipe(sass({
includePaths: ["src/**/*.scss"],
}))
.pipe(autoprefixer({
browsers: ["last 2 versions"],
cascade: false
}))
.pipe(cleanCSS())
.pipe(sourcemaps.write())
.pipe(gulp.dest("./dist"));
});
示例9:
gulp.task("build.css.dev", () => {
gulp.src(["src/themes/*.scss"])
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(sass({
includePaths: ["src/**/*.scss"],
}))
.pipe(autoprefixer({
browsers: ["last 2 versions"],
cascade: false
}))
.pipe(sourcemaps.write("./"))
.pipe(plumber.stop())
.pipe(gulp.dest("./dist/dev"))
});