vite-plugin-tailwind-obfusacte

A Vite plugin to obfuscate Tailwind CSS class when running on production.

Screen Shot 2022-06-10 at 07 15 21

Screen Shot 2022-06-10 at 07 14 37

Installation

Warning This plugin is still in development. Proceed with caution.

Install plugin with npm

npm i vite-plugin-tailwind-obfuscate
// https://vitejs.dev/config/

import obfuscate from "vite-plugin-tailwind-obfuscate";

export default defineConfig({
  plugins: [
    obfuscate()
  ],
});

Configuration

export default defineConfig({
  plugins: [
    obfuscate({
      dev: true,  // by default it only run on production. set to true to run on dev and production.
      min: 2,     // minimum number of characters in the obfuscated string.
      max: 8,     // maximum number of characters in the obfuscated string.
      length: 8,  // if length is provided, it will be used instead of min and max.
    })
  ],
});

Supported frameworks

  • Vue
  • React
  • Svelte (coming soon)

Running Tests

To run tests, run the following command

npm run test

Authors

Feedback

If you have any feedback, please reach out to us at misbah.ansori24@gmail.com