在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):unlight/gulp-cssimport开源软件地址(OpenSource Url):https://github.com/unlight/gulp-cssimport开源编程语言(OpenSource Language):JavaScript 87.4%开源软件介绍(OpenSource Introduction):gulp-cssimportParses a CSS file, finds imports, grabs the content of the linked file and replaces the import statement with it. INSTALLnpm install gulp-cssimport USAGEvar gulp = require("gulp");
var cssimport = require("gulp-cssimport");
var options = {};
gulp.task("import", function() {
gulp.src("src/style.css")
.pipe(cssimport(options))
.pipe(gulp.dest("dist/"));
}); OPTIONSincludePathsArray, default: skipCommentsBoolean, default: filterRegExp, default: var options = {
filter: /^http:\/\//gi // process only http urls
}; matchPatternString, glob pattern string. See minimatch for more details. var options = {
matchPattern: "*.css" // process only css
};
var options2 = {
matchPattern: "!*.{less,sass}" // all except less and sass
}; Note:
matchOptionsObject, minimatch options for limitNumber, default transformFunction, default
Arguments:
extensionsDeprecated, use var options = {
extensions: ["css"] // process only css
};
var options = {
extensions: ["!less", "!sass"] // all except less and sass
}; TIPS AND TRICKSBe more precise and do not add to src importing file without necessary: // main.css
@import "a.css";
@import "b.css"; If you will do Use filter option: POSTCSSThere are plugins for PostCSS which do same job or even better:
SIMILAR PROJECTShttps://npmjs.org/package/gulp-coimport/ KNOWN ISSUES
TODO
CHANGELOGSee CHANGELOG Support |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论