
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@uvarov.frontend/pug-bem-plain-loader
Advanced tools
Pug that adds BEM shortcuts to plain html loader for webpack
Pug that adds BEM shortcuts to plain html loader for webpack
pug-bem-plain-loader is a combination of pug-plain-loader and pug-bem plugins
Now you can specify your own prefixes for blocks in the b property:
loaders: {
'pug': {
loader: 'pug-bem-plain-loader',
options: {
b: 'my-' // block prefix
}
}
}
or
loaders: {
'pug': {
loader: 'pug-bem-plain-loader',
options: {
b: true // default 'b-'
}
}
}
npm install pug pug-bem-plain-loader --save-dev
Settings match pug-plain-loader and pug-bem
module: {
rules: [
... // other rules
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
// this applies to <template lang="pug"> in Vue components
'pug': [
'pug-bem-plain-loader'
]
}
}
}
... // other rules
]
}
or
module: {
rules: [
... // other rules
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
// this applies to <template lang="pug"> in Vue components
'pug': {
loader: 'pug-bem-plain-loader',
options: {
e: '**', // element separator, default: __
m: '++' // modifier separator, default: --
}
}
}
}
}
... // other rules
]
}
<template lang="pug">
header.header
nav.menu
a(href="#")._logo Company
.list
a._item.-active(href="#") Home
a._item(href="#") News
a._item(href="#") Gallery
a._item(href="#") Partners
a._item(href="#") About
a._item(href="#") Contacts
h1._title Hello, World!
.myslider._myslider
._slide Content
._slide.-active Content
._slide Content
p._text Good weather
</template>
<header class="header">
<nav class="menu">
<a class="menu__logo" href="#">Company</a>
<div class="list">
<a class="list__item list__item--active" href="#">Home</a>
<a class="list__item" href="#">News</a>
<a class="list__item" href="#">Gallery</a>
<a class="list__item" href="#">Partners</a>
<a class="list__item" href="#">About</a>
<a class="list__item" href="#">Contacts</a>
</div>
</nav>
<h1 class="header__title">Hello, World!</h1>
<div class="myslider header__myslider">
<div class="myslider__slide">Content</div>
<div class="myslider__slide myslider__slide--active">Content</div>
<div class="myslider__slide">Content</div>
</div>
<p class="header__text">Good weather</p>
</header>
ISC License
Legostaev Vadim (legostaev.vadim@mail.ru)
FAQs
Pug that adds BEM shortcuts to plain html loader for webpack
The npm package @uvarov.frontend/pug-bem-plain-loader receives a total of 0 weekly downloads. As such, @uvarov.frontend/pug-bem-plain-loader popularity was classified as not popular.
We found that @uvarov.frontend/pug-bem-plain-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.