You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -8,7 +8,7 @@ Install the package with NPM and add it to your devDependencies:
8
8
9
9
`npm install --save-dev webpack-obfuscator`
10
10
11
-
### Usage:
11
+
### Plugin usage:
12
12
13
13
```javascript
14
14
var JavaScriptObfuscator =require('webpack-obfuscator');
@@ -17,9 +17,32 @@ var JavaScriptObfuscator = require('webpack-obfuscator');
17
17
18
18
// webpack plugins array
19
19
plugins: [
20
-
newJavaScriptObfuscator ({
21
-
rotateStringArray:true
22
-
}, ['excluded_bundle_name.js'])
20
+
newJavaScriptObfuscator ({
21
+
rotateStringArray:true
22
+
}, ['excluded_bundle_name.js'])
23
+
]
24
+
```
25
+
26
+
### Loader usage:
27
+
28
+
Define a rule in your webpack config and use the obfuscator-loader as the last of your loaders for your modules. You can add the **enforce: 'post'** flag to ensure the loader will be called after normal loaders:
29
+
30
+
```javascript
31
+
// webpack loader rules array
32
+
rules: [
33
+
{
34
+
test:/\.js$/,
35
+
exclude: [
36
+
path.resolve(__dirname, 'excluded_file_name.js')
37
+
],
38
+
enforce:'post',
39
+
use: {
40
+
loader:'obfuscator-loader',
41
+
options: {
42
+
rotateStringArray:true
43
+
}
44
+
}
45
+
}
23
46
]
24
47
```
25
48
@@ -30,7 +53,7 @@ Options for [javascript-obfuscator](https://github.com/javascript-obfuscator/jav
30
53
31
54
**Warning:** right now plugin does not support `sourceMap` and `sourceMapMode` options!
32
55
33
-
### excludes
56
+
### excludes (plugin only)
34
57
Type: `Array` or `String` Default: `[]`
35
58
36
59
Bundle name is output file name after webpack compilation. With multiple webpack entries you can set bundle name in `output` object with aliases `[name]` or `[id]`.
0 commit comments