File tree Expand file tree Collapse file tree 5 files changed +13
-5
lines changed Expand file tree Collapse file tree 5 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ You must use the wrapper around [`debug`](https://www.npmjs.com/package/debug) n
12
12
13
13
Do not:
14
14
* Alias your ` import ` or ` require ` of ` Debug `
15
- * Spread your ` import ` of ` require ` of ` Debug ` over more than one line
16
- * Put more than one ` debug() ` call on a single line
15
+ * Spread your ` require ` of ` Debug ` over more than one line
16
+ * Wrap code with ` debug();like(this);debug() ` on the same line
17
17
* Other crazy things
18
18
19
19
Just make simple debug statements.
@@ -36,6 +36,7 @@ if (foo) {
36
36
' foo happened' ,
37
37
foo,
38
38
{ ... foo }
39
+ someFunc (foo)
39
40
)
40
41
}
41
42
```
Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ import { t } from 'ttag'
3
3
import isObject from 'lodash/isObject'
4
4
5
5
import { findFilterById , findFilterByType } from './search/filters'
6
-
6
+ import {
7
+ Debug
8
+ } from 'webpack-strip-debug-loader'
7
9
import { browserHistory } from '../Routes'
8
10
import * as waterApi from '../waterApi'
9
11
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ describe('purge', () => {
15
15
it ( 'removes imports for Debug' , ( ) => {
16
16
expect ( purge ( "import { Debug } from 'webpack-strip-debug-loader'" ) ) . toBe ( '\n' )
17
17
expect ( purge ( 'import {Debug} from "webpack-strip-debug-loader"' ) ) . toBe ( '\n' )
18
+ expect (
19
+ purge ( `import {
20
+ Debug
21
+ } from 'webpack-strip-debug-loader'` )
22
+ ) . toBe ( '\n' )
18
23
} )
19
24
20
25
it ( 'removes requires for Debug' , ( ) => {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " webpack-strip-debug-loader" ,
3
- "version" : " 1.2.3 " ,
3
+ "version" : " 1.3.0 " ,
4
4
"description" : " Strips debug imports, declarations and expressions from your webpack bundles" ,
5
5
"main" : " dist" ,
6
6
"type" : " module" ,
Original file line number Diff line number Diff line change 1
1
const imports =
2
- / i m p o r t \s . + \s f r o m \s + [ ' " ] w e b p a c k - s t r i p - d e b u g - l o a d e r [ ' " ] | .* r e q u i r e \( [ ' " ] w e b p a c k - s t r i p - d e b u g - l o a d e r [ ' " ] \) .* /
2
+ / i m p o r t \s ? { \s * ? D e b u g \s * ? } \s f r o m \s + [ ' " ] w e b p a c k - s t r i p - d e b u g - l o a d e r [ ' " ] | .* r e q u i r e \( [ ' " ] w e b p a c k - s t r i p - d e b u g - l o a d e r [ ' " ] \) .* /
3
3
const declarations = / ( v a r | l e t | c o n s t ) ? \s * d e b u g ( \w ? ) + \s * = \s * D e b u g \( [ \s \S ] * ?.* \) /
4
4
const invocations = / \s * d e b u g ( \w ? ) + \s * ?\( [ \s \S ] * ?.* \s * \) (? ! [ ) , ] ) /
5
5
const debugCode = new RegExp (
You can’t perform that action at this time.
0 commit comments