Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-javascript-obfuscator

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-javascript-obfuscator

A Vite Plugin for javascript-obfuscator

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.8K
increased by1.23%
Maintainers
1
Weekly downloads
 
Created
Source

vite-plugin-javascript-obfuscator

A Vite Plugin for javascript-obfuscator

Installation

Install the package:

  • npm npm install --save-dev vite-plugin-javascript-obfuscator
  • yarn yarn add --dev vite-plugin-javascript-obfuscator
  • pnpm pnpm i vite-plugin-javascript-obfuscator -D

Usage

Example 1

vite.config.js

import obfuscatorPlugin from "vite-plugin-javascript-obfuscator";

export default defineConfig({
  plugins: [
    obfuscatorPlugin({
      options: {
        // your javascript-obfuscator options
        debugProtection: true,
        // ...  [See more options](https://github.com/javascript-obfuscator/javascript-obfuscator)
      },
    }),
  ],
});

Example 2

vite.config.js

import obfuscatorPlugin from "vite-plugin-javascript-obfuscator";

export default defineConfig({
  plugins: [
    obfuscatorPlugin({
      include: ["src/path/to/file.js", "path/anyjs/**/*.js", /foo.js$/],
      exclude: [/node_modules/],
      apply: "build",
      debugger: true,
      options: {
        // your javascript-obfuscator options
        debugProtection: true,
        // ...  [See more options](https://github.com/javascript-obfuscator/javascript-obfuscator)
      },
    }),
  ],
});

Params

NameTypeDefaultDescription
includeArray|String|RegExp|Function[/\.(jsx?|tsx?|cjs|mjs)$/]Configure this option to include files
excludeArray|String|RegExp|Function[/node_modules/, /\.nuxt/]Configure this option to exclude files
optionsObjectjavascript-obfuscator default optionsSee more options
apply'serve' | 'build'both serve and build.By default plugins are invoked for both serve and build. In cases where a plugin needs to be conditionally applied only during serve or build, use the apply property to only invoke them during vite build or vite serve
debuggerBooleanfalseUsed for debugging, Print out the path of matching or excluding files.

Keywords

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc