javascript-obfuscator / javascript-obfuscator/webpack-obfuscator

Loader doesn't work, but plugin does

Open
#147 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
928
Forks
92
PR merge metrics
No merged PRs in 30d

Description

What am I missing? I have this config under `module.rules`:
```
{
test: /\.js$/,
exclude: /node_modules/,
enforce: 'post',
use: {
loader: WebpackObfuscator.loader,
options: {
debugProtection: true,
disableConsoleOutput: true,
rotateStringArray: true,
selfDefending: true,
}
}
}
```

And it doesn't obfuscate. But if I use it as a plugin:
```
new WebpackObfuscator({
debugProtection: true,
disableConsoleOutput: true,
rotateStringArray: true,
selfDefending: true,
}),
```

Then it works just fine 🤔

```
"javascript-obfuscator": "^3.0.0",
"webpack": "^5.65.0",
"webpack-obfuscator": "^3.5.0"
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported module.rules loader configuration with javascript-obfuscator 3.0.0, webpack 5.65.0, and webpack-obfuscator 3.5.0, then compare it with the working plugin configuration. Done means the loader obfuscates the generated JavaScript with the same options, or the issue documents the required loader setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.