Product
Introducing Ruby Support in Socket
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
pug-loader
Advanced tools
var template = require("pug!./file.pug");
// => returns file.pug content as template function
var locals = { /* ... */ };
var html = template(locals);
// => the rendered HTML
For more information on how to use Webpack loaders, check the official documentation.
.jade
filespug-loader fully supports .jade
files. Just use pug-loader with .jade
files as you would with a .pug
file.
The following options are available to be set as part of the loader query. They are all mapped directly to Pug options, unless pointed out otherwise.
doctype
"html"
if not setglobals
self
plugins
read
or resolve
hooks, as those are reserved for the loaderpretty
root
Try to use require
for all your embedded resources, to process them with webpack.
div
img(src=require("./my/image.png"))
Remember, you need to configure loaders for these file types too. You might be interested in the file loader.
FAQs
Pug loader module for webpack
The npm package pug-loader receives a total of 32,409 weekly downloads. As such, pug-loader popularity was classified as popular.
We found that pug-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.