在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Wildhoney/gulp-processhtml开源软件地址(OpenSource Url):https://github.com/Wildhoney/gulp-processhtml开源编程语言(OpenSource Language):JavaScript 77.8%开源软件介绍(OpenSource Introduction):gulp-processhtmlGulp plugin uses Denis Ciccale's node-htmlprocessor to process/transform html files.
Gulpfilevar gulp = require('gulp'),
processhtml = require('gulp-processhtml')
opts = { /* plugin options */ };
gulp.task('default', function () {
return gulp.src('./*.html')
.pipe(processhtml(opts))
.pipe(gulp.dest('dist'));
}); Example UsageYou might need to change some attributes in your html, when you're releasing for a different environment. Using this plugin, you can transform this: <!DOCTYPE html>
<html>
<head>
<!-- build:css style.min.css -->
<link rel="stylesheet" href="css/style.css">
<!-- /build -->
</head>
<body>
<!-- build:js app.min.js -->
<script src="app.js"></script>
<!-- /build -->
<!-- build:remove -->
<script src="http://192.168.0.1:35729/livereload.js?snipver=1"></script>
<!-- /build -->
<!-- build:replace 'Goodbye Livereload...' -->
<script src="http://192.168.0.1:35729/livereload.js?snipver=1"></script>
<!-- /build -->
</body>
</html> To this: <!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.min.css">
</head>
<body>
<script src="app.min.js"></script>
Goodbye Livereload...
</body>
</html> Credits |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论