File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ export default function transformCssModules({ types: t }) {
180
180
]
181
181
) ;
182
182
183
- if ( thisPluginOptions . keepImport === true ) {
183
+ if ( thisPluginOptions && thisPluginOptions . keepImport === true ) {
184
184
path . parentPath . replaceWithMultiple ( [
185
185
t . expressionStatement (
186
186
t . callExpression (
@@ -216,7 +216,7 @@ export default function transformCssModules({ types: t }) {
216
216
path . replaceWith ( buildClassNameToScopeNameMap ( tokens ) ) ;
217
217
218
218
// Keeped import will places before closest expression statement child
219
- if ( thisPluginOptions . keepImport === true ) {
219
+ if ( thisPluginOptions && thisPluginOptions . keepImport === true ) {
220
220
findExpressionStatementChild ( path , t ) . insertBefore (
221
221
t . expressionStatement (
222
222
t . callExpression (
@@ -226,7 +226,7 @@ export default function transformCssModules({ types: t }) {
226
226
)
227
227
) ;
228
228
}
229
- } else if ( thisPluginOptions . keepImport !== true ) {
229
+ } else if ( ! thisPluginOptions || thisPluginOptions . keepImport !== true ) {
230
230
path . remove ( ) ;
231
231
}
232
232
}
You can’t perform that action at this time.
0 commit comments