javascript-obfuscator / webpack-obfuscator

javascript-obfuscator plugin for Webpack
https://github.com/javascript-obfuscator/javascript-obfuscator
BSD 2-Clause "Simplified" License
856 stars 84 forks source link

webpack-obfuscator not working with vue-monaco #86

Closed RomanCood closed 3 years ago

RomanCood commented 3 years ago

Hello,

I have encountered a problem since I integrated this library: https://github.com/egoist/vue-monaco Here is the error when I build Screenshot_1

If I don't use JavaScriptObfuscator, the vue-monaco plugin works fine !

The webpack-obfuscator config:

new JavaScriptObfuscator ({
    compact: true,
    controlFlowFlattening: false,
    controlFlowFlatteningThreshold: 0.75,
    deadCodeInjection: false,
    deadCodeInjectionThreshold: 0.4,
    debugProtection: false,
    debugProtectionInterval: false,
    disableConsoleOutput: true,
    domainLock: [],
    identifierNamesGenerator: 'hexadecimal',
    identifiersPrefix: '_ED_',
    inputFileName: '',
    log: true,
    renameGlobals: false,
    reservedNames: [],
    reservedStrings: [],
    rotateStringArray: true,
    rotateUnicodeArray: true,
    seed: 0,
    selfDefending: true,
    sourceMap: false,
    sourceMapBaseUrl: '',
    sourceMapFileName: '',
    sourceMapMode: 'separate',
    stringArray: true,
    stringArrayEncoding: true,
    stringArrayThreshold: 0.75,
    target: 'browser',
    transformObjectKeys: false,
    unicodeEscapeSequence: false,
}, ['**vue-monaco.js', '**vue-monaco.es.js'])

My dependencies:

"dependencies": {
    "@chenfengyuan/vue-qrcode": "^1.0.2",
    "@hscmap/vue-window": "^2.4.2",
    "@quasar/extras": "^1.6.4",
    "aframe": "1.0.3",
    "aframe-physics-system": "4.0.1",
    "axios": "^0.18.1",
    "blockly": "^3.20200402.1",
    "jszip": "^3.3.0",
    "monaco-editor-webpack-plugin": "^1.9.0",
    "node-blockly": "^1.2.8",
    "patch-package": "^6.2.2",
    "pressure": "^2.1.2",
    "quasar": "^1.9.15",
    "socket.io-client": "^2.3.0",
    "vue-i18n": "^8.0.0",
    "vue-monaco": "^1.2.1",
    "vue-socket.io-extended": "^4.0.1",
    "vuex-persistedstate": "^2.7.1",
    "vuex-shared-mutations": "^1.0.2",
    "webpack-obfuscator": "^1.9.0",
    "zip-loader": "^1.1.0"
  },

Is there something I forgot to do? Have you ever encountered this error with another plugin?

sanex3339 commented 3 years ago

Try to increase max available memory for Node.js

NODE_OPTIONS=--max_old_space_size=4096 webpack OTHER_WEBPACK_OPTIONS
RomanCood commented 3 years ago

Thanks but I already tried it and got the same error.

sanex3339 commented 3 years ago

And even 8192 value didn't help?

RomanCood commented 3 years ago

Yes, unfortunately it didn't help.

sanex3339 commented 3 years ago

I need a reproducible example (repository) then.

RomanCood commented 3 years ago

I use quasar framework. The solution is to increase memory as you said but the command line was not exactly the same.

Thank you !