obfuscit
v1.0.3
Published
Plugin for Vite that helps you protect your stylesheet code by obfuscating TailwindCSS, Bulma, Bootstrap and more
Downloads
16
Maintainers
Readme
Obfuscit ⚡
Classes Obfuscator for Svelte. Protect your TailwindCSS, Bulma, Bootstrap and more classes from unauthorized copying. Current support includes Svelte, with upcoming features to support Vite, Webpack and Turbopack as well.
- 💡 Easy to Use
- ⚡️ Lightweight and Fast
- 🛠️ Customizable
- 📦 Support for Multiple Bundlers
- 🔩 Comprehensive Functionalities
- 🔑 Robust Protection for your TailwindCSS, Bulma, Bootstrap and more
[!NOTE]
Some classes likespace-{direction}-{size}
anddivide-{direction}-{size}
may not be obfuscated due this time. I'm working on it.
Roadmap
- [x] Customizable classname length/prefix/suffix
- [x] Support for SveteKit
- [x] Support for Vite
- [ ] Support for Webpack
- [ ] Support for Turbopack
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Prerequisites
This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.
$ npm -v && node -v
6.4.1
v8.16.0
Installation
BEFORE YOU INSTALL: please read the prerequisites
To install and set up the library, run:
$ npm install -D obfuscit
Or if you prefer using Yarn:
$ yarn add --dev obfuscit
Or if you prefer using PNPM:
$ pnpm add -D obfuscit
Usage
Add Obfuscit to your SvelteKit Project
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import Obfuscit from 'obfuscit';
export default defineConfig({
plugins: [
sveltekit({}),
Obfuscit({
length: 4,
prefix: 'obf-',
suffix: '-test'
})
]
});
Update build
command
Update your package.json
to include the twobfus
command in the build
script.
{
"scripts": {
"build": "obfus --clean && <your-build-command>"
}
}
Command Properties
twobfus
$ npx obfus --clean
Arguments
clean
- Clean old obfuscated class mappings
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Add your changes:
git add .
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :sunglasses:
Authors
- waffpi - Noob
See also the list of contributors who participated in this project.
License
MIT License © waffpi