在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):koistya/gulp-render开源软件地址(OpenSource Url):https://github.com/koistya/gulp-render开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-render
How to Install$ npm install gulp-render --save-dev How to UseExample 1:var gulp = require('gulp');
var render = require('gulp-render');
gulp.task('default', function() {
return gulp.src('src/pages/**/*.jsx')
.pipe(render({template: 'src/pages/_template.html'}))
.pipe(gulp.dest('build'));
}); Example 2:var gulp = require('gulp');
var render = require('gulp-render');
gulp.task('default', function() {
return gulp.src('src/pages/**/*.jsx')
.pipe(render({
template:
'<!doctype html>' +
'<html><head><title><%=title%></title></head>' +
'<body><%=body%></body></html>',
harmony: false,
data: {title: 'Page Title'}
}))
.pipe(gulp.dest('build'));
});
React Component Sample ( |
option | values | default |
---|---|---|
template |
Lo-Dash template string or filename | null |
harmony |
true : enable ES6 features |
true |
stripTypes |
true : enable Flow type annotations |
true |
hyphenate |
true : SomePage.jsx -> some-page.html |
true |
staticMarkup |
true : HTML output will not have data-react-* attributes |
false |
data |
E.g. {title: 'Hello'} or function(file) { ... } |
object or function |
React.js Starter Kit - a skeleton for an isomorphic web application (SPA)
The MIT License (MIT) @ Konstantin Tarkus (@koistya)
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论