@christian-beckmann/parcel-transformer-twig

0.1.1 • Public • Published

parcel-transformer-twig

Parcel v2 transformer plugin for twig (twig.js).

Inspired of Parcel v1 plugin parcel-plugin-twig

Installation

npm i -D christian-beckmann/parcel-transformer-twig

Configuration

.parcelrc Parcel Configuration

{
  "extends": ["@parcel/config-default"],
  "transformers": {
    "*.twig": ["@christian-beckmann/parcel-transformer-twig"]
  }
}

Reference Parcel plugin configuration

Customization

You can add custom options for ejs templating engine using a .twigrc, .twigrc.js file.

For more information on customization options, see twig.js

Watching subfolder *.twig files

To watch included/embedded files, parcel needs to know the folder (because twig.js doesn't inform parcel about the included files).

.twigrc

{
  "watchFolder": "./src"
}

Cons

New created files won't be watched. Reload to watch new twig files.

Package Sidebar

Install

npm i @christian-beckmann/parcel-transformer-twig

Weekly Downloads

2

Version

0.1.1

License

none

Unpacked Size

3.81 kB

Total Files

3

Last publish

Collaborators

  • christian-beckmann