javascript-obfuscator / javascript-obfuscator/webpack-obfuscator

Vue 2 webapp fails to build (Webpack)

未关闭
#130 4 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
928
派生
92
PR 合并指标
30 天内没有已合并 PR

描述

Hi

Versions:
`
"webpack-obfuscator": "^2.6.0",
"@vue/cli-service": "^4.5.13",
"vue": "^2.6.11",
`

I am trying to obfuscate my vue.js 2 webapp. My cue.config.js looks like this
`const fs = require('fs')

module.exports = {
chainWebpack: config => {
config.module.rules.delete('eslint')

var JavaScriptObfuscator = require('webpack-obfuscator');
config.plugin('obfuscation').enforce = 'post';
config.plugin('obfuscation').use(JavaScriptObfuscator, [
{
compact: false,
controlFlowFlattening: false,
controlFlowFlatteningThreshold: 0.75,
deadCodeInjection: false,
deadCodeInjectionThreshold: 0.4,
debugProtection: false,
debugProtectionInterval: false,
disableConsoleOutput: false,
identifierNamesGenerator: 'hexadecimal',
log: true,
numbersToExpressions: false,
renameGlobals: false,
selfDefending: false,
simplify: false,
splitStrings: false,
splitStringsChunkLength: 10,
stringArray: false,
stringArrayEncoding: ['base64'],
stringArrayIndexShift: false,
stringArrayRotate: false,
stringArrayThreshold: 0.75,
stringArrayShuffle: true,
stringArrayWrappersCount: 2,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersParametersMaxCount: 4,
sourceMap: false,
stringArrayWrappersType: 'function',
transformObjectKeys: false,
target: 'node',
unicodeEscapeSequence: false
}, []]);
},
outputDir: process.env.OUTPUT_DIR
}`

I disabled all options but i cannot get it to work. As soon as i run `npm run serve --open` the app is compiled and the browser opens, but i get no output (i should be redirected to the login page of my app). Instead i get the attached error in my browser console

Im unsure what i am doing wrong here

![js obfuscator](https://user-images.githubusercontent.com/9249624/142955861-2f53d414-675d-474a-b7cf-2a7c5bb19d58.jpg)
e

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 cue.config.js 中的 webpack 配置开始,并使用 npm run serve --open 重现该问题。将附图中显示的浏览器控制台错误与 webpack-obfuscator 和 Vue CLI 的设置进行比较。当 webapp 构建并打开登录页面,且不再出现报告的浏览器错误时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, webpack
领域
build-system, frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。