0.1.19 • Published 5 years ago

parcel-plugin-ssg-precompile v0.1.19

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

parcel-plugin-ssg-precompile

Comapnion plugin for parcel-plugin-ssg that adds precompile support for certain template engines.

Usage

Add the plugin to your project as a dependency:

npm install parcel-plugin-ssg-precompile --save

This will generate a precompiled javascript template to allow dynamic re-use in the client. This template is automatically added to the generated HTML via a script tag.

Please see usage instructions specific to the supported template engines:

Nunjucks

To use your precompiled template in the client, you must include the nunjucks or nunjucks-slim.js library in your bundle or on the page via a script tag. I.e,

const nunjucks = require('nunjucks');

const updated = nunjucks.render('example-template.js', {title: 'My example page'})

document.innerHTML(updated);
<script>
    const nunjucks = require('nunjucks');
    const updated = nunjucks.render('example-template.js', {title: 'My example page'})
    document.innerHTML(updated);
</script>
0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago