在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):MaKleSoft/gulp-style-modules开源软件地址(OpenSource Url):https://github.com/MaKleSoft/gulp-style-modules开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-style-modulesA gulp plugin for wrapping css files into style modules as used by Polymer Install$ npm install --save-dev gulp-style-modules Examplesvar stylemod = require('gulp-style-modules');
// Wrap css files
gulp.task("modularize-styles", function() {
gulp.src("./src/**/*.css")
.pipe(stylemod({
// All files will be named 'styles.html'
filename: "styles",
// Use '-css' suffix instead of '-styles' for module ids
moduleId: function(file) {
return path.basename(file.path, path.extname(file.path)) + "-css";
}
}))
.pipe(gulp.dest("./src"));
}
// Use with preprocessor (e.g. stylus)
gulp.task("modularize-styles", function() {
gulp.src("./src/**/*.styl")
.pipe(stylus({use: [nib()]}))
.pipe(stylemod())
.pipe(gulp.dest("./src"));
} Options / Defaults{
// string / function to be used for file names. Can be either a fixed string or a function
// that takes a [vinyl](https://github.com/gulpjs/vinyl) file object and returns a string
filename: function(file) {
return path.basename(file.path, path.extname(file.path)) + "-styles";
},
// string / function to be used for module ids. Can be either a fixed string or a function
// that takes a [vinyl](https://github.com/gulpjs/vinyl) file object and returns a string
moduleId: function(file) {
return path.basename(file.path, path.extname(file.path)) + "-styles";
}
} MITLICENSE |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论