Socket
Socket
Sign inDemoInstall

vite-mahlzeit-obfuscator

Package Overview
Dependencies
85
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vite-mahlzeit-obfuscator

A plugin to obfuscate javascript for Vite at build time.


Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

vite-mahlzeit-obfuscator

Install

Run the following command:

npm i vite-mahlzeit-obfuscator --save-dev

How to use

Make the following changes to vite.config.js:

import { defineConfig } from "vite";
import obfuscator from "vite-mahlzeit-obfuscator";

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

Then run the build command:

npm run build

If you just want to obfuscate specific files you can provide a regular expression, as follows:

import { defineConfig } from "vite";
import obfuscator from "vite-mahlzeit-obfuscator";

export default defineConfig({
  plugins: [
    obfuscator({
      includeRegEx: /^[\w,\s-]+\.[A-Za-z]{3}$/, // 👈 just an example
    }),
  ],
});

If you want to pass obfuscator options, you can do it like this:

import { defineConfig } from "vite";
import obfuscator from "vite-mahlzeit-obfuscator";

export default defineConfig({
  plugins: [
    obfuscator({
      options: {
        compact: true,
        simplify: true,
        stringArrayShuffle: true,
      },
    }),
  ],
});

Credits

This package was inspired by the following projects:

  • rollup-obfuscator
  • vite-plugin-javascript-obfuscator

License

MIT

Keywords

FAQs

Last updated on 21 Mar 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc