# parcel-plugin-ssg-precompile

> A parcel plugin for precompiling support consolidate.js engine templates

Latest version **0.1.19** (published 2019-01-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install parcel-plugin-ssg-precompile
pnpm add parcel-plugin-ssg-precompile
yarn add parcel-plugin-ssg-precompile
bun add parcel-plugin-ssg-precompile
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.19 |
| Published | 2019-01-16 |
| First published | 2018-12-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | chrisdmacrae |
| Maintainers | chrisdmacrae |

## Links

- npm: https://www.npmjs.com/package/parcel-plugin-ssg-precompile
- Homepage: http:
- npm.io page: https://npm.io/package/parcel-plugin-ssg-precompile

## Dependencies (3)

- [nunjucks](https://npm.io/package/nunjucks.md) ^3.1.6
- [normalize-path](https://npm.io/package/normalize-path.md) ^3.0.0
- [parcel-plugin-ssg](https://npm.io/package/parcel-plugin-ssg.md) ^0.1.18

## Recent versions

- 0.1.19 (latest) — 2019-01-16
- 0.1.18 — 2019-01-16
- 0.1.17 — 2019-01-16
- 0.1.16 — 2019-01-16
- 0.1.15 — 2019-01-09
- 0.1.14 — 2018-12-17
- 0.1.13 — 2018-12-17
- 0.1.12 — 2018-12-17
- 0.1.11 — 2018-12-17
- 0.1.10 — 2018-12-17
- 0.1.8 — 2018-12-15
- 0.1.7 — 2018-12-15
- 0.1.6 — 2018-12-15
- 0.1.5 — 2018-12-15
- 0.1.4 — 2018-12-14
- … 2 more at https://npm.io/package/parcel-plugin-ssg-precompile/versions

## README

# `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](#nunjucks)

## 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,

```js
const nunjucks = require('nunjucks');

const updated = nunjucks.render('example-template.js', {title: 'My example page'})

document.innerHTML(updated);
```

```html
<script>
    const nunjucks = require('nunjucks');
    const updated = nunjucks.render('example-template.js', {title: 'My example page'})
    document.innerHTML(updated);
</script>
```

---
_Source: https://npm.io/package/parcel-plugin-ssg-precompile · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
