在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):cognitom/gulp-sketch开源软件地址(OpenSource Url):https://github.com/cognitom/gulp-sketch开源编程语言(OpenSource Language):CoffeeScript 95.9%开源软件介绍(OpenSource Introduction):gulp-sketchA SketchTool plugin for gulp. InstallIf you're using Sketch.app $ npm install gulp-sketch --save-dev Are you new to Sketch.app or the user of ver < 3.5 ? See the section below. Usagevar gulp = require('gulp');
var sketch = require('gulp-sketch');
gulp.task('sketch', function(){
return gulp.src('./src/sketch/*.sketch')
.pipe(sketch({
export: 'slices',
formats: 'png'
}))
.pipe(gulp.dest('./dist/images/'));
}); or write it in CoffeeScript. gulp = require 'gulp'
sketch = require 'gulp-sketch'
gulp.task 'sketch', ->
gulp.src './src/sketch/*.sketch'
.pipe sketch
export: 'slices'
formats: 'png'
.pipe gulp.dest './dist/images/' OptionsThe options are the same as what's supported by
Additionally, it has
For debugging purposes, it has
Layer NamingWhen exporting slices, the name of layer is the key to decide the name of the file exported.
Bohemian Coding mentioned about it in their article.
Should include or not include generated files?Basically not. But sometimes it would be controversial. Because tools like
How to skip a task for Windows userCheck var gulp = require('gulp');
var sketch = require('gulp-sketch');
var gutil = require('gulp-util')
var which = require('npm-which')(__dirname);
gulp.task('sketch', function(){
try {
which.sync('sketchtool');
} catch(error){
gutil.log(error); return;
}
return gulp.src('./src/sketch/*.sketch')
.pipe(sketch({
export: 'slices',
formats: 'png'
}))
.pipe(gulp.dest('./dist/images/'));
}); Install SketchToolAfter the version 3.5, Sketch.app has started bundling I'm a developer and not have a license of Sketch.appDon't worry, the tool doesn't need a license. Run this command to install: $ npm run install-sketchtool I'm a user of the older version of Sketch.app (< ver 3.5)Download SketchTool and install it to your environment by hand. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论