3.1.0 • Published 4 months ago

lahm-plugin-javascript-obfuscator v3.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

lahm-plugin-javascript-obfuscator

A Lahm Plugin for javascript-obfuscator

Installation

Install the package:

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

Usage

Example 1

lahm.config.js

import obfuscatorPlugin from "lahm-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

lahm.config.js

import obfuscatorPlugin from "lahm-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 lahm build or lahm serve
debuggerBooleanfalseUsed for debugging, Print out the path of matching or excluding files.