Skip to content

Commit

Permalink
1.8.3 release: fixed wrapping of require calls with conditional comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sanex3339 committed Jul 28, 2020
1 parent 76f6bd7 commit 4301d9b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions declarations/ESTree.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as ESTree from 'estree';

declare module 'estree' {
export interface BaseNode {
start?: number;
end?: number;
}
}
6 changes: 3 additions & 3 deletions loader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class WebpackObfuscatorLoaderHelper {

estraverse.traverse(astTree, {
enter: (node: ESTree.Node): void => {
if (WebpackObfuscatorLoaderHelper.isRequire(node) && node.range) {
if (WebpackObfuscatorLoaderHelper.isRequire(node) && node.start && node.end) {
entries.push({
start: node.range[0],
end: node.range[1],
start: node.start,
end: node.end,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webpack-obfuscator",
"version": "1.8.2",
"version": "1.8.3",
"description": "javascript-obfuscator plugin for Webpack",
"keywords": [
"obfuscator",
Expand Down

0 comments on commit 4301d9b

Please sign in to comment.