JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q88929F
  • License MIT

Helper function to make tiny classnames for modular-css

Package Exports

  • @modular-css/shortnames
  • @modular-css/shortnames/namer.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@modular-css/shortnames) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@modular-css/shortnames NPM Version NPM License NPM Downloads

Tiny classnames for modular-css production builds!

Install

> npm install @modular-css/shortnames

Usage

JS API

const Processor = require("@modular-css/processor");
const processor = new Processor({
    namer : require("@modular-css/shortnames")()
});
    
// ...

Browserify

build.plugin("@modular-css/browserify", {
    css   : "./style.css",
    namer : require("@modular-css/shortnames")()
});

// ...

Rollup

rollup({
    entry   : "./index.js",
    plugins : [
        require("@modular-css/rollup")({
            css   : "./gen/index.css",
            namer : require("@modular-css/shortnames")()
        })
    ]
});

Example output

/* one.css */
.alert {}
.notification {}

/* two.css */
.title {}
.heading .subheading {}

becomes

/* output.css */
.AA {}
.AB {}

.BA {}
.BB .BC {}