javascript-obfuscator/webpack-obfuscator

Webpack obfuscator not working for webpack 4.xx versions

premkumarthanigaivel opened this issue · 3 comments

Webpack version: ^4.41.2
Webpack-dev-server:^3.9.0
Webpack-cli:^3.3.10

Webpack Obfuscator returning this error while running with webpack dev server:

Uncaught TypeError: webpack_require(...) is not a function
at eval (webpack:///(:8081/webpack)/buildin/module.js?:2:123)
at Object../node_modules/webpack/buildin/module.js (main.367d319a1f307a626a92.js:19402)
at webpack_require (main.367d319a1f307a626a92.js:790)
at fn (main.367d319a1f307a626a92.js:101)
at eval (index.js:2)
at Object../node_modules/strip-ansi/index.js (main.367d319a1f307a626a92.js:19040)
at webpack_require (main.367d319a1f307a626a92.js:790)
at fn (main.367d319a1f307a626a92.js:101)
at Object.eval (webpack:///(:8081/webpack)-dev-server/client?:1:742)
at eval (webpack:///(:8081/webpack)-dev-server/client?:2:30)

Per the suggestion from npm website installed below versions of obfuscator:
webpack-obfuscator: "0.18.3"
javascript-obfuscator: "0.18.3"

After excluding node modules, works like a charm

@premkumarthanigaivel How do you exclude node_modules? List them one by one?

@premkumarthanigaivel How do you exclude node_modules? List them one by one?

@joshuakoh1 Its my bad, that i was expecting obfuscator to run in webpack dev server, only later did i realise that, static build is working fine.