Skip to content

Commit 40de1f1

Browse files
committed
tidying
1 parent 3bbd479 commit 40de1f1

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/generators/shared/utils/wrapModule.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -272,21 +272,13 @@ function getGlobals(dependencies: Dependency[], options: CompileOptions) {
272272
const error = new Error(
273273
`Could not determine name for imported module '${d.source}' – use options.globals`
274274
);
275-
if (onerror) {
276-
onerror(error);
277-
} else {
278-
throw error;
279-
}
275+
onerror(error);
280276
} else {
281277
const warning = {
282278
message: `No name was supplied for imported module '${d.source}'. Guessing '${d.name}', but you should use options.globals`,
283279
};
284280

285-
if (onwarn) {
286-
onwarn(warning);
287-
} else {
288-
console.warn(warning); // eslint-disable-line no-console
289-
}
281+
onwarn(warning);
290282
}
291283

292284
name = d.name;
@@ -303,4 +295,4 @@ function getGlobalFn(globals: any): (id: string) => string {
303295
}
304296

305297
return () => undefined;
306-
}
298+
}

0 commit comments

Comments
 (0)