File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ const config: RollupOptions = {
1616 include : 'config.js' ,
1717 exclude : 'node_modules/**' ,
1818 delimiters : [ '<@' , '@>' ] ,
19+ objectGuards : true ,
1920 preventAssignment : true ,
2021 VERSION : '1.0.0' ,
2122 ENVIRONMENT : JSON . stringify ( 'development' ) ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export interface RollupReplaceOptions {
1212 | Replacement
1313 | RollupReplaceOptions [ 'include' ]
1414 | RollupReplaceOptions [ 'values' ]
15+ | RollupReplaceOptions [ 'objectGuards' ]
1516 | RollupReplaceOptions [ 'preventAssignment' ] ;
1617
1718 /**
@@ -33,6 +34,12 @@ export interface RollupReplaceOptions {
3334 * of `foo`, supply delimiters
3435 */
3536 delimiters ?: [ string , string ] ;
37+ /**
38+ * When replacing dot-separated object properties like `process.env.NODE_ENV`,
39+ * will also replace `typeof process` object guard checks against the objects
40+ * with the string `"object"`.
41+ */
42+ objectGuards ?: boolean ;
3643 /**
3744 * Prevents replacing strings where they are followed by a single equals
3845 * sign.
You can’t perform that action at this time.
0 commit comments