gulp-ejs-monster
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "gulp-ejs-monster", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "OBT", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -32,6 +32,11 @@ # gulp-ejs-monster | ||
const watchAndTouch = require('gulp-watch-and-touch'); // give +100500 for incremental build | ||
// give +100500 for incremental build | ||
const isWatching = true; | ||
const watchAndTouch = require('gulp-watch-and-touch'); | ||
const fileWatcher = watchAndTouch(gulp); | ||
const isWatching = true; | ||
// format | ||
const isProduction = true; | ||
const jsBeautify = require('js-beautify'); | ||
// Send some data for your workflow | ||
@@ -53,6 +58,6 @@ const ejsData = { | ||
ext: '.html', // or .php, or ... | ||
layouts: './src/markup/layouts', // resolve path | ||
partials: './src/markup/partials', // resolve path | ||
configs: './src/markup/configs', // resolve path | ||
controllers: './src/markup/controllers', // resolve path | ||
layouts: './src/ejs/layouts', // resolve path | ||
partials: './src/ejs/partials', // resolve path | ||
configs: './src/ejs/configs', // resolve path | ||
controllers: './src/ejs/controllers', // resolve path | ||
reservedLocalsKeys: [ // protected properties from writing | ||
@@ -64,4 +69,18 @@ 'NODE_MODULES', | ||
if (isWatching) { | ||
let filePath = file.path; | ||
let sources = data.__INSTANCE.SOURCES.files[filePath] || []; | ||
fileWatcher(filePath, filePath, sources); | ||
} | ||
if (__ARGS.flags.production) { | ||
let beautyMarkup = jsBeautify.html(markup, { | ||
indent_level: 0, | ||
eol: '\n', | ||
max_preserve_newlines: 1, | ||
// ... | ||
}); | ||
return beautyMarkup; | ||
} | ||
} | ||
@@ -81,6 +100,4 @@ }; | ||
## features | ||
#### markup | ||
### block | ||
base.ejs layout | ||
@@ -134,2 +151,17 @@ | ||
header.ejs partial | ||
```html | ||
<% | ||
let { | ||
title = 'default header title' | ||
} = ENTRY; | ||
-%> | ||
<header> | ||
<div class="center"> | ||
<div class="title"><%- title %></div> | ||
</div> | ||
</header> | ||
``` | ||
128999
163