You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param options.exclude Array of module names to exclude from Flow transformation (defaults to empty array)
62
68
* @param options.all If true, bypasses looking for @flow pragma comment before parsing (defaults to true)
63
69
* @param options.ignoreUninitializedFields If true, removes uninitialized class fields completely rather than only removing the type (defaults to false)
70
+
* @param options.removeEmptyImports If true, removes empty import statements which were only used for importing flow types (defaults to true)
64
71
*
65
72
* @returns Array of rules for transforming Flow typed modules
66
73
*/
@@ -69,6 +76,7 @@ export function getFlowTransformRules({
69
76
exclude =[],
70
77
all =true,
71
78
ignoreUninitializedFields =false,
79
+
removeEmptyImports =true,
72
80
}: GetFlowTransformRulesOptions={}){
73
81
return[
74
82
{
@@ -78,7 +86,7 @@ export function getFlowTransformRules({
78
86
exclude: getModulePaths(exclude),
79
87
use: {
80
88
loader: '@callstack/repack/flow-loader',
81
-
options: { all, ignoreUninitializedFields },
89
+
options: { all, ignoreUninitializedFields, removeEmptyImports},
0 commit comments