在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):carrot/gulp-accord开源软件地址(OpenSource Url):https://github.com/carrot/gulp-accord开源编程语言(OpenSource Language):CoffeeScript 90.2%开源软件介绍(OpenSource Introduction):gulp-accordA fast, simple, and well-tested way to compile many languages with a unified interface.
Why should you care?You're hip and modern, and you know that it makes life a lot easier to use compiled languages when you are writing html, css, and/or javascript. So many of your projects use tools like jade, stylus, sass, or coffeescript, and build them out to vanilla html, css, and javascript before deploys. It also just so happens that you use and love gulp as your build tool. While you can certainly find one-off adapters for each of these languages, wouldn't it be easier if they all had a consistent, unified, and well-tested interface that always supports all options, and the latest version of the language? And wouldn't it be nice to just have to install a single gulp plugin to handle all of them? If you answered yes to any of the above, that is why you should care. Language SupportGulp-accord supports these languages at the moment. Below you can find a usually-up-to-date adapter list:
If there are other languages you would like for accord to support, please make your suggestions and pull requests to accord itself, not to this plugin. Installation
Also make sure that you have the language you want to compile with accord installed. So for example, if you are using gulp to compile jade, you'd also run UsageBelow is an example of basic usage. In this case, we would be using gulp-accord to compile some jade templates. var accord = require('gulp-accord');
gulp.task('compile', function(){
gulp.src('templates/*.jade')
.pipe(accord('jade', { pretty: true }))
}); As you can probably infer from this example, the accord plugin takes two arguments, the name of the language you are compiling, and the options you want to pass to it. The name should be a string, and the options are optional, but if present, should be an object. You can find more information about the available options for each language here. Source MapsIf a language has support for source maps, this plugin will allow you to product them using gulp's standard sourcemaps tool. You can use it as specified in the docs, and gulp-accord will produce the sourcemaps for you automatically. For example, the task shown below would compile a stylus file and produce an external sourcemap: var gulp = require('gulp'),
sourcemaps = require('gulp-sourcemaps'),
accord = require('gulp-accord');
gulp.task('default', function(){
gulp.src('./test.styl')
.pipe(sourcemaps.init())
.pipe(accord('stylus'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./out'))
}); License & Contributing
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论