pagejs-webpack-plugin
v1.0.2
Published
Covert pagejs (.page.js) files into raw html.
Downloads
1
Readme
pagejs-webpack-plugin
Plugin for compiling PageJS to html files.
Installation
npm install pagejs-webpack-plugin
Config
Require the package in your webpack file. const pagejsWebpackPlugin = require('pagejs-webpack-plugin')
.
Include the plugin in your plugin list.
plugins: [
new pagejsWebpackPlugin()
]
You're free to change the default ext if you wish { ext: 'new' } ex: index.new.js
,
Usage
Create file, ex index.page.js
(page.js
being the default ext).
Use Page syntax skipping declaring the main object.
({ title: 'My website!' })
.h1({ style: 'color: blue' }, 'Hello world!')
.div('How are you today?', (el)=>{
el.br()
el.span('Wonderful I hope.')
})
This will output an html file of the same name.
Template
Feel free to test it out in this demo project: PageJS Template Project
License
MIT (http://www.opensource.org/licenses/mit-license.php)