在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):armed/gulp-flatten开源软件地址(OpenSource Url):https://github.com/armed/gulp-flatten开源编程语言(OpenSource Language):JavaScript 99.7%开源软件介绍(OpenSource Introduction):gulp-flatten
Install
UsageExample source directory with bower compoments:
By default var flatten = require('gulp-flatten');
gulp.src('bower_components/**/*.min.js')
.pipe(flatten())
.pipe(gulp.dest('build/js')); Result will be list of all
Optionsflatten(options)options.newPathType: Relative path for file. options.includeParentsType: If passed in as positive number, it will include the number of top-level parents in the output. Using this code: gulp.src(['bower_components/**/*.css'])
.pipe(flatten({ includeParents: 1} ))
.pipe(gulp.dest('build/')); will create this structure (from sample directory tree above):
If passed in as negative number, it will include the number of bottom-level parents in the output. Using this code: gulp.src(['bower_components/**/*.css'])
.pipe(flatten({ includeParents: -1} )) //or indludeParents: [0, 1]
.pipe(gulp.dest('build/')); will create this structure:
If passes as array of two numbers, both parents from top and bottom will be kept in resulting path of a file. gulp.src(['bower_components/**/*.css'])
.pipe(flatten({ includeParents: [1, 1]} ))
.pipe(gulp.dest('build/')); will create this structure:
options.subPathType: Number or Array of two Numbers [begin, end] This options applies gulp.src(['bower_components/**/*.css'])
.pipe(flatten({ subPath: [1, 1]} ))
.pipe(gulp.dest('build/')); This as an example would flatten
Please refer to the Array.slice documentation for a detailed description. ! If you're using both LicenseMIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论