@uking/webpack-obfuscator-plugin
Advanced tools
Comparing version
@@ -13,4 +13,5 @@ import { Compiler } from 'webpack'; | ||
private shouldExclude; | ||
private getFileName; | ||
private extractSourceAndSourceMap; | ||
private obfuscate; | ||
} |
@@ -32,2 +32,3 @@ "use strict"; | ||
compilation.chunks.forEach(chunk => { | ||
let chunkName = this.getFileName(chunk.name); | ||
chunk.files.forEach((fileName) => { | ||
@@ -50,3 +51,3 @@ if (this.options.sourceMap && fileName.toLowerCase().endsWith('.map')) { | ||
.some((extension) => fileName.toLowerCase().endsWith(extension)); | ||
if (!isValidExtension || this.shouldExclude(fileName)) { | ||
if (!chunkName || this.shouldExclude(chunkName) || !isValidExtension || this.shouldExclude(fileName)) { | ||
return; | ||
@@ -79,2 +80,8 @@ } | ||
} | ||
getFileName(filePath) { | ||
if (!filePath) | ||
return ''; | ||
const parts = filePath.split('/'); | ||
return parts[parts.length - 1]; | ||
} | ||
extractSourceAndSourceMap(asset) { | ||
@@ -81,0 +88,0 @@ if (asset.sourceAndMap) { |
{ | ||
"name": "@uking/webpack-obfuscator-plugin", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "javascript-obfuscator plugin for Webpack@5", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
24892
1.22%354
2.31%