Skip to content

Commit 1cb547f

Browse files
committed
init commit#2
1 parent f6d58e9 commit 1cb547f

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea
2-
node_modules
2+
node_modules
3+
npm-debug.log

index.js

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ declare let module: any;
44
declare let require: any;
55

66
let multimatch: any = require('multimatch'),
7-
JavaScriptObfuscator = require('javascript-obfuscator');
7+
RawSource: any = require('webpack-core/lib/RawSource'),
8+
JavaScriptObfuscator: any = require('javascript-obfuscator');
89

910
class WebpackObfuscator {
1011
public options: any = {};
@@ -42,7 +43,7 @@ class WebpackObfuscator {
4243
files.forEach((file) => {
4344
let asset = compilation.assets[file];
4445

45-
compilation.assets[file] = JavaScriptObfuscator.obfuscate(asset.source(), this.options);
46+
compilation.assets[file] = new RawSource(JavaScriptObfuscator.obfuscate(asset.source(), this.options));
4647
});
4748

4849
callback();

0 commit comments

Comments
 (0)