const JavaScriptObfuscator = require('javascript-obfuscator');const fs = require('fs');const path = require('path');// 获取要混淆的输入文件路径,这里假设是构建后的js文件,可根据实际情况调整const inputFile = path.join(__dirname, 'dist/assets/index.js');// 定义混淆后的输出文件路径const output...
constobfuscationResult =JavaScriptObfuscator.obfuscate(it.content, {/** 这些都是配置 */compact:false,controlFlowFlattening:true,controlFlowFlatteningThreshold:1,numbersToExpressions:true,simplify:true,stringArrayShuffle:true,splitStrings:true,stringArrayThreshold:1}) fs.writeFile(buildDir + it.fileName, o...
安装插件 yarn add --dev rollup-plugin-javascript-obfuscator 创建obfuscator.js文件,把下面相应代码放入js文件中 importobfuscatorPluginfrom'rollup-plugin-javascript-obfuscator';exportfunctioncodeObfuscatorPlugin(isBuild) {if(!isBuild) {return[]; }constcodeObfuscator = { ...obfuscatorPlugin({rotateUnicodeArra...
yarn add --dev rollup-plugin-javascript-obfuscator 1. 创建obfuscator.js文件,把下面相应代码放入js文件中 import obfuscatorPlugin from 'rollup-plugin-javascript-obfuscator'; export function codeObfuscatorPlugin(isBuild) { if (!isBuild) { return []; } const codeObfuscator = { ...obfuscatorPlugin({ ...
javascript-obfuscator是一个常用的JavaScript混淆工具。 3. 查找Vite是否支持内置的混淆配置或插件 Vite本身并不提供内置的混淆配置,但你可以通过配置Rollup的插件来实现这一功能。 4. 寻找兼容Vite的第三方混淆插件 rollup-plugin-obfuscator是一个兼容Rollup(因此也兼容Vite)的插件,可以用于混淆JavaScript代码。 5. 配置...
javascriptObfuscator({ compact: true, controlFlowFlattening: true, controlFlowFlatteningThreshold: 1, deadCodeInjection: true, deadCodeInjectionThreshold: 1, debugProtection: true, debugProtectionInterval: 0, disableConsoleOutput: true, identifierNamesGenerator...
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...
.prettierignore LICENSE README.md package.json pnpm-lock.yaml rollup.config.mjs tsconfig.json yarn.lock Breadcrumbs vite-plugin-javascript-obfuscator / .DS_Store Latest commit Cannot retrieve latest commit at this time. HistoryHistory File metadata and controls Code Blame 6 KB Raw Vi...
A plugin to obfuscate javascript for Vite at build time.. Latest version: 0.1.4, last published: 2 years ago. Start using vite-mahlzeit-obfuscator in your project by running `npm i vite-mahlzeit-obfuscator`. There are 3 other projects in the npm registry
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` ##Usage vite.config.js ```javascript importobfuscatorPluginfrom'vite-plugin-javascript-obfuscator' ...