danguilherme / ng-cli-pug-loader

:sparkles: Angular schematics to add .pug to your project
GNU General Public License v3.0
56 stars 17 forks source link

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

Closed thegnuu closed 11 months ago

antonpegov commented 6 years ago

I want it too!

danguilherme commented 5 years ago

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

sinsunsan commented 5 years ago

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.

JoshuaNitschke commented 5 years ago

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.

jsalvans commented 5 years ago

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

danguilherme commented 11 months ago

This project is no longer maintained.