Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

scriptor's avatar

Using javascript-obfuscator with laravel-mix

Hi, I was curious if anyone has a tutorial on how to setup https://github.com/javascript-obfuscator/javascript-obfuscator with laravel-mix webpack.

Thank you.

0 likes
2 replies
clark's avatar

@scriptor I know this was a long time ago, did you ever find a good resource for this? I'm also trying to figure out the best way to integrate javascript-obfuscator with laravel-mix.

hillcow's avatar

include in webpack.mix.js:

let JavaScriptObfuscator = require('webpack-obfuscator');
mix.webpackConfig({
    plugins: [
        new JavaScriptObfuscator ({
            rotateUnicodeArray: true
        }, ['excluded_bundle_name.js'])
    ],
});

Please or to participate in this conversation.