
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
pug-plain-loader
Advanced tools
A loader that simply compiles pug templates into HTML.
Note pug is a peer dependency, so make sure to install both:
npm install -D pug-plain-loader pug
This loader is mostly intended to be used alongside vue-loader v15+, since it now requires using webpack loaders to handle template preprocessors. There's also pug-html-loader which unfortunately is out-of-date and not actively maintained.
If you are only using this loader for templating in single-file Vue components, simply configure it with:
{
module: {
rules: [
{
test: /\.pug$/,
loader: 'pug-plain-loader'
}
]
}
}
This will apply this loader to all <template lang="pug"> blocks in your Vue components.
If you also intend to use it to import .pug files as HTML strings in JavaScript, you will need to chain raw-loader after this loader. Note however adding raw-loader would break the output for Vue components, so you need to have two rules, one of them excluding Vue components:
{
module: {
rules: [
{
test: /\.pug$/,
oneOf: [
// this applies to pug imports inside JavaScript
{
exclude: /\.vue$/,
use: ['raw-loader', 'pug-plain-loader']
},
// this applies to <template lang="pug"> in Vue components
{
use: ['pug-plain-loader']
}
]
}
]
}
}
See Pug compiler options.
The doctype option is set to html by default, since most Vue templates are HTML fragments without explicit doctype.
An additional option data can be used to pass locals for the template, although this is typically not recommended when using in Vue components.
FAQs
Pug to plain html loader for webpack
The npm package pug-plain-loader receives a total of 51,723 weekly downloads. As such, pug-plain-loader popularity was classified as popular.
We found that pug-plain-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.