ng-cli-pug-loader icon indicating copy to clipboard operation
ng-cli-pug-loader copied to clipboard

Question: Is it possible to enhance this plugin that ng generate creates pug files?

Open thegnuu opened this issue 5 years ago • 5 comments

thegnuu avatar Aug 28 '18 09:08 thegnuu

I want it too!

antonpegov avatar Nov 02 '18 20:11 antonpegov

This will probably need ~more~ shenanigans to work. I think it's possible, will take a look when I can.

danguilherme avatar Jan 02 '19 13:01 danguilherme

I was wondering if is possible also. it is not so much a work to rename the file after ng generate component have been used, but would be more integrated if the component pug file was directly a pug file. As it is the case for scss.

sinsunsan avatar Mar 01 '19 09:03 sinsunsan

It's easy, you just need to do the following:

Update Angular Schematics to Generate .pug

  1. Go to: node_modules⁩/@schematics⁩/angular⁩/component⁩/files⁩/
  2. Rename name@dasherize.component.html.template => name@dasherize.component.pug.template
  3. Update pug template to pug (p <%= dasherize(name) %> works!)
  4. Update tsfile template to reference pug file: name@dasherize.component.ts.template (.component.html => .component.pug)

I've been too lazy to write a script to do this, but since other people are asking I'll try to find time in the next month to make a PR for this feature.

JoshuaNitschke avatar Jun 13 '19 17:06 JoshuaNitschke

I have created a bash script that modifies the Angular Schematics to generate .pug

You can choose whether to replace the default command or create a separate one for the .pug (ng generate pug-component).

https://gist.github.com/jsalvans/449cc9e5acf69ffde937d10f2f02853e

jsalvans avatar Jul 09 '19 09:07 jsalvans

This project is no longer maintained.

danguilherme avatar Nov 21 '23 23:11 danguilherme