pagejs-webpack-plugin

1.0.2 • Public • Published

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)

Package Sidebar

Install

npm i pagejs-webpack-plugin

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

4.38 kB

Total Files

4

Last publish

Collaborators

  • ayn