javascript-obfuscator / javascript-obfuscator/webpack-obfuscator

Vue 2 webapp fails to build (Webpack)

Open
#130 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
928
Forks
92
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the webpack configuration in cue.config.js and reproduce the problem with npm run serve --open. Compare the browser-console error shown in the attached image with the webpack-obfuscator and Vue CLI setup. Done means the webapp builds and opens to its login page without the reported browser error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.