1.0.6 • Published 3 years ago

parcel-transformer-pug-precompile v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

parcel-transformer-pug-precompile

Plugin for parcel v2. Precompile pug templates into javascript sources exporting their compiling functions.

Install

npm install -D parcel-transformer-pug-precompile
yarn add -D parcel-transformer-pug-precompile

Usage

.parcelrc

{
  "extends": ["@parcel/config-default"],
  "transformers": {
    "*.pug": ["parcel-transformer-pug-precompile"]
  }
}

index.html

<!DOCTYPE html>
...
<html>
<body>
  <div id="app"></div>
  <script src="./index.js"></script>
</body>
</html>

template.pug

h1 Hello #{whom}!

index.js

import compileTemplate from './template.pug';

const app = document.getElementById('app');
app.innerHTML = compileTemplate({ whom: 'World' });
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago