Socket
Socket
Sign inDemoInstall

@fox-js/vite-plugin-js-obfuscator

Package Overview
Dependencies
0
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @fox-js/vite-plugin-js-obfuscator

javascript obfuscator plugin


Version published
Weekly downloads
1
decreased by-50%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

Fox vite-plugin-js-obfuscator

js文件混淆插件,基于javascript-obfuscator开发

Install

NPM

npm i @fox-js/vite-plugin-js-obfuscator javascript-obfuscator -D

YARN

yarn add @fox-js/vite-plugin-js-obfuscator javascript-obfuscator -D

PNPM

pnpm add @fox-js/vite-plugin-js-obfuscator javascript-obfuscator -D

使用指南


import { UserConfigExport, ConfigEnv, loadEnv } from 'vite'
import jsObfuscator from '@fox-js/vite-plugin-js-obfuscator'
import { join } from 'path'

export default ({ command, mode }: ConfigEnv): UserConfigExport => {
  return {
    plugins: [
       jsObfuscator({
        globalOptions: prodMode ? {} : false,
        fileOptions: prodMode ? {} : false
      }),
    ]
  }
}

插件参数类型


export interface VitePluginObfuscatorOptions {
    /**
     * Global options, applied when rendering chunks. Pass `false` to disable.
     */
    globalOptions: ObfuscatorOptions | false;
    /**
     * Per-file options, applied when transforming files, include/exclude works for this option. Pass `false` to disable.
     */
    fileOptions: ObfuscatorOptions | false;
    /**
     * match
     * 是否对文件进行混淆,返回false不处理
     */
    match: {
        (path: string): boolean;
    };
}
/**
 * model name plugin工厂
 * @param options
 * @returns
 */
declare function jsObfuscatorPlugin(options?: Partial<VitePluginObfuscatorOptions>): Plugin;

Keywords

FAQs

Last updated on 20 Feb 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