Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@uvarov.frontend/pug-bem-plain-loader

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uvarov.frontend/pug-bem-plain-loader

Pug that adds BEM shortcuts to plain html loader for webpack

latest
npmnpm
Version
1.1.6
Version published
Maintainers
1
Created
Source

pug-bem-plain-loader

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

  • BEM

New! v1.1.0

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-'
    }
  }
}

Install

npm install pug pug-bem-plain-loader --save-dev

Usage

Settings match pug-plain-loader and pug-bem

Example for Vue Single-File Components

webpack.config.js

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
    ]
  }

App.vue

<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>

Result

<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>

License

ISC License

Author

Legostaev Vadim (legostaev.vadim@mail.ru)

Keywords

pug

FAQs

Package last updated on 12 Aug 2021

Did you know?

Socket

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.

Install

Related posts