在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):appleboy/gulp-compass开源软件地址(OpenSource Url):https://github.com/appleboy/gulp-compass开源编程语言(OpenSource Language):JavaScript 83.1%开源软件介绍(OpenSource Introduction):gulp-compass
Requirements
Please refer the user guide InstallationInstall with npm
UsageLoad config from config.rbPlease make sure to add
var compass = require('gulp-compass');
gulp.task('compass', function() {
gulp.src('./src/*.scss')
.pipe(compass({
config_file: './config.rb',
css: 'stylesheets',
sass: 'sass'
}))
.pipe(gulp.dest('app/assets/temp'));
}); Load config without config.rbset your project path. var compass = require('gulp-compass'),
path = require('path');
gulp.task('compass', function() {
gulp.src('./src/*.scss')
.pipe(compass({
project: path.join(__dirname, 'assets'),
css: 'css',
sass: 'sass'
}))
.pipe(gulp.dest('app/assets/temp'));
}); set your compass settings. var compass = require('gulp-compass'),
minifyCSS = require('gulp-minify-css');
gulp.task('compass', function() {
gulp.src('./src/*.scss')
.pipe(compass({
css: 'app/assets/css',
sass: 'app/assets/sass',
image: 'app/assets/images'
}))
.pipe(minifyCSS())
.pipe(gulp.dest('app/assets/temp'));
}); Support multiple require option var compass = require('gulp-compass'),
minifyCSS = require('gulp-minify-css');
gulp.task('compass', function() {
gulp.src('./src/*.scss')
.pipe(compass({
css: 'app/assets/css',
sass: 'app/assets/sass',
image: 'app/assets/images',
require: ['susy', 'modular-scale']
}))
.pipe(minifyCSS())
.pipe(gulp.dest('app/assets/temp'));
}); Support return the output of the Compass as the callback var compass = require('gulp-compass'),
minifyCSS = require('gulp-minify-css');
gulp.task('compass', function() {
gulp.src('./src/*.scss')
.pipe(compass({
css: 'app/assets/css',
sass: 'app/assets/sass',
image: 'app/assets/images'
}))
.on('error', function(error) {
// Would like to catch the error here
console.log(error);
this.emit('end');
})
.pipe(minifyCSS())
.pipe(gulp.dest('app/assets/temp'));
});
var compass = require('gulp-compass'),
plumber = require('gulp-plumber'),
minifyCSS = require('gulp-minify-css');
gulp.task('compass', function() {
gulp.src('./src/*.scss')
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
this.emit('end');
}}))
.pipe(compass({
css: 'app/assets/css',
sass: 'app/assets/sass',
image: 'app/assets/images'
}))
.on('error', function(err) {
// Would like to catch the error here
})
.pipe(minifyCSS())
.pipe(gulp.dest('app/assets/temp'));
}); ConfigurationConfiguration Optionsstyledefault: nested description: The output style for the compiled css. One of: nested, expanded, compact, or compressed. commentsdefault: false description: Show line comments or not. relativedefault: true description: Are assets relative. cssdefault: css description: The target directory where you keep your css stylesheets. It is relative to the sassdefault: sass description: The source directory where you keep your sass stylesheets. It is relative to the javascriptdefault: js description: The directory where you keep your javascripts. It is relative to the fontdefault: font description: The directory where you keep your fonts. It is relative to the projectdefault: your project base description: The location where all your assets are store. loggingdefault: true description: show/hide compile log message. import_pathdefault: false format: description: The directory where you keep external Compass plugins or extensions that you would like to make available using the requiredefault: false format: description: Require the given Ruby library before running commands. This is used to access Compass plugins without having a project configuration file. load_alldefault: false description: Load all the frameworks or extensions found in the FRAMEWORKS_DIR directory. bundle_execdefault: false description: Run compass compile with bundle exec: sourcemapdefault: false description: Generate standard JSON source maps. PS. Past compass versions (prior to 1.0.0) do not support
timedefault: false description: Display compilation times. debugdefault: false description: Turns on sass's debuging information. environmentdescription: The environment mode can also be http_pathdefault: false description: Set this to the root of your project when deployed. generated_images_pathdefault: false description: GENERATED_IMAGES_PATH. Support taskdefault: compile description: Support compass primary commands: compile or watch. Running tests
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论