Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Pug As Jsx Loader | 175 | 15 | 6 | 2 years ago | 90 | July 24, 2020 | 28 | mit | JavaScript | |
Webpack Component Loader | 107 | 1 | 5 years ago | 22 | October 17, 2017 | 2 | mit | JavaScript | ||
📦 A webpack loader to componentify CSS/JS/HTML without framework | ||||||||||
Pug Plain Loader | 102 | 1,067 | 714 | 3 years ago | 2 | December 09, 2020 | 6 | mit | JavaScript | |
webpack loader that transforms pug templates to plain HTML | ||||||||||
Pug Static Loader | 6 | 6 years ago | 1 | other | JavaScript | |||||
Webpack loader that compiles pug to html | ||||||||||
Webpack File Inherit | 5 | 1 | 3 years ago | 5 | March 13, 2021 | 4 | mit | TypeScript | ||
Webpack loader that enables pug like inheritance for any file type | ||||||||||
Tag Pug Loader | 4 | 7 years ago | 1 | mit | JavaScript | |||||
Integrating RiotJS with PugJS (ex Jade) as a Webpack loader | ||||||||||
Virtual Jade Loader | 4 | 6 years ago | JavaScript | |||||||
Webpack loader for translating Jade templates to virtual-dom Hyperscript | ||||||||||
Pug Extract Loader | 2 | 4 years ago | gpl-3.0 | JavaScript | ||||||
webpack loader to extract pug to HTML, calling all dependencies found in the code | ||||||||||
Pug Asset Loader | 1 | 6 years ago | mit | JavaScript | ||||||
Webpack loader to process Pug file assets |
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.