File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const DEFAULT_OPTIONS: ScanOptions & WithScanOptions = {
1818 includeChildren : true ,
1919 log : false ,
2020 clearLog : false ,
21+ production : false ,
2122} ;
2223let currentOptions : ScanOptions & WithScanOptions = DEFAULT_OPTIONS ;
2324export const getCurrentOptions = ( ) => currentOptions ;
@@ -53,7 +54,10 @@ export const scan = (
5354) => {
5455 currentOptions = options ?? currentOptions ;
5556
56- if ( inited || isInIframe ( ) || currentOptions . enabled === false || isProd ( ) ) {
57+ if ( ! currentOptions . production && isProd ( ) ) {
58+ return ;
59+ }
60+ if ( inited || isInIframe ( ) || currentOptions . enabled === false ) {
5761 return ;
5862 }
5963 inited = true ;
Original file line number Diff line number Diff line change @@ -73,6 +73,12 @@ export interface ScanOptions {
7373 * @default true
7474 */
7575 log ?: boolean ;
76+ /**
77+ * Also run in production
78+ *
79+ * @default false
80+ */
81+ production ?: boolean ;
7682}
7783
7884export interface WithScanOptions {
Original file line number Diff line number Diff line change 77 enabled : true ,
88 log : true ,
99 clearLog : true ,
10+ production : true ,
1011} ) ;
1112
1213export const App = ( ) => {
You can’t perform that action at this time.
0 commit comments