posthtml-vnjson-screen
v0.0.2
Published
Custom elements plugin for vnjson
Downloads
4
Readme
posthtml-vnjson-screen
Install
npm i -D posthtml-vnjson-screen
Usage
source.html
<main-menu>
<h1>main-menu</h1>
</main-menu>
<settings>
<h1>settings</h1>
</settings>
<gameover>
<h1>gameover</h1>
</gameover>
<memory-card>
<h1>memory-card</h1>
</memory-card>
gulpfile.js
const
gulp = require('gulp'),
posthtml = require('posthtml'),
vnjsonScreen = require('posthtml-vnjson-screen');
gulp.task('html', () => {
const plugins = [
vnjsonScreen({
defaultTag: 'section',
prefix: "vnjson__",
skipTags: []
}),
];
gulp.src('./src/screens/**/*.html')
.pipe(posthtml(plugins))
.pipe(concat('screens.html'))
.pipe(gulp.dest('tmp/'))
});
dest.html
<section id="vnjson__main-menu" style="display:none">
<h1>main-menu</h1>
</section>
<section id="vnjson__settings" style="display:none">
<h1>settings</h1>
</section>
<section id="vnjson__gameover" style="display:none">
<h1>gameover</h1>
</section>
<section id="vnjson__memory-card" style="display:none">
<h1>memory-card</h1>
</section>
Options
{
defaultTag: 'section',
prefix: "vnjson__",
skipTags: []
}
LICENSE
MIT License (MIT)