Parcel: Parcel 2: Pug transformer

Created on 12 Aug 2019  ·  6Comments  ·  Source: parcel-bundler/parcel

Create the @parcel/transformer-pug package in packages/transforms/pug. This package is a Parcel 2 transform plugin for pug. It should be based on the PugAsset from Parcel 1.

The @parcel/transformer-pug package is responsible for the following things:

  • Loading config from .pugrc, .pugrc.js
  • Compiling pug to HTML
  • Collecting dependencies as included files so Parcel watches them
Good First Issue Help Wanted ✨ Parcel 2 🔌 Parcel 2 Plugins

Most helpful comment

@devongovett Almost right. It should allow for doing both at the same time, so it would first check whether it's required from a JS file or an HTML file. The code to produce the result is very similar actually. I could try taking a stab at it, since I've already written the JS-only part for parcel v1 https://github.com/mkg20001/parcel-plugin-pug-client

Edit: The reason being, that both are required as .pug files. So it would pass through the same transformer initially.

All 6 comments

Hey @devongovett, I can work on this.

@jkher awesome! Let us know if you have any questions. 😍

Could this issue be considered in the building of the pug transformer: https://github.com/parcel-bundler/parcel/issues/1854 ?

Besides the issue I mentioned, is there anything missing to get this shipped?

Initial implementation is complete.

@mkg20001 I think this would be a separate transformer to produce JS from Pug instead of HTML, no?

@devongovett Almost right. It should allow for doing both at the same time, so it would first check whether it's required from a JS file or an HTML file. The code to produce the result is very similar actually. I could try taking a stab at it, since I've already written the JS-only part for parcel v1 https://github.com/mkg20001/parcel-plugin-pug-client

Edit: The reason being, that both are required as .pug files. So it would pass through the same transformer initially.

Was this page helpful?
0 / 5 - 0 ratings