简体   繁体   中英

How can I integrate pug templating engine in angular using angular cli?

Currently I'm working on angular project that uses HTML. Now I want to integrate Pug templating engine in my project. How can I integrate Pug in my Angular project using AngularCLI? Any one can help?

For Angular8 you can run ng add ng-cli-pug-loader@0.2 .
For Angular6+ run ng add ng-cli-pug-loader .
If your want to update old project to angular8, remove your node_modules and reinstall all package.
ng-cli-pug-loader

I know it's too late, but it still might be useful for somebody.

Angular Pug Builders could be used for Angular >=v12 .

To use it with the current Angular version just run:

ng add ngx-pug-builders

or for Angular 12:

ng add ngx-pug-builders@12

See details at GitHub repo here .

As far as I know Angular uses its own html parser, looks like your task doens't make a sense. I don't see any reason to intergate pug there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM