Skip to content

Commit c1ffa65

Browse files
committed
Support multiline debug calls with func calls as arguments
1 parent e86752a commit c1ffa65

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack-strip-debug-loader",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Strips debug imports, declarations and expressions from your webpack bundles",
55
"main": "dist",
66
"repository": {

src/purge.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const purge = source => {
22
// No Imports: /import\s.+\sfrom\s+['"]webpack-strip-debug-loader['"]|.*require\(['"]webpack-strip-debug-loader['"]\).*/
33
// No Declarations: /(var|let|const)?\s+debug(\w?)+\s*=\s*Debug\([\s\S]*?.*\)/g
4-
// No Invocations: /\s*debug(\w?)+\s*?\([\s\S]*?.*\)/g
4+
// No Invocations: /\s*debug(\w?)+\s*?\([\s\S]*?.*\s*\)(?![\),])/g
55

66
return source.replace(
7-
/(import\s.+\sfrom\s+['"]webpack-strip-debug-loader['"]|.*require\(['"]webpack-strip-debug-loader['"]\).*)|((var|let|const)?\s+debug(\w?)+\s*=\s*Debug\([\s\S]*?.*\))|(\s*debug(\w?)+\s*?\([\s\S]*?.*\))/g,
7+
/(import\s.+\sfrom\s+['"]webpack-strip-debug-loader['"]|.*require\(['"]webpack-strip-debug-loader['"]\).*)|((var|let|const)?\s+debug(\w?)+\s*=\s*Debug\([\s\S]*?.*\))|(\s*debug(\w?)+\s*?\([\s\S]*?.*\s*\)(?![\),]))/g,
88
'\n'
99
)
1010
}

0 commit comments

Comments
 (0)