JSPM

nextjs-plugin-minify-css-classname

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

A Next.js plugin to minify css classnames.

Package Exports

  • nextjs-plugin-minify-css-classname
  • nextjs-plugin-minify-css-classname/lib/index.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 (nextjs-plugin-minify-css-classname) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

nextjs-plugin-minify-css-classname

version NPM Build Test codecov typescript

A Next.js plugin to minify css classnames. No any external dependencies.

🚧 Before

<main class="App_content_g9yLL">
  <p class="Message_message_7VBcg">hello,
    <span class="Message_strong_kQiZl">world!</span>
  </p>
</main>

after

<main class="a">
  <p class="b">hello,
    <span class="c">world!</span>
  </p>
</main>

🔌 Installation

$ npm install -D nextjs-plugin-minify-css-classname

or

$ yarn add -D nextjs-plugin-minify-css-classname

🏄 Usage

next.config.js

// Automatically enable on production build
const { withMinifyClassnames } = require('nextjs-plugin-minify-css-classname');

module.exports = withMinifyClassnames({
  // other configs
})
// or manually enable
const { withMinifyClassnamesConfig } = require('nextjs-plugin-minify-css-classname');

module.exports = withMinifyClassnamesConfig({
  enabled: process.env.NODE_ENV === 'production',
})({
  // other configs
})

🏁 LICENSE

MIT