Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
Return null from the transform hook when it doesn't transform anything
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Dec 12, 2018
1 parent 97953e1 commit bb58960
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function babel(options) {
const helpers = preflightCheck(this, babelOptions, id);

if (!helpers) {
return { code };
return null;
}

if (helpers === EXTERNAL && !externalHelpers) {
Expand All @@ -101,7 +101,7 @@ export default function babel(options) {
const transformed = transform(code, localOpts);

if (!transformed) {
return { code };
return null;
}

return {
Expand Down

0 comments on commit bb58960

Please sign in to comment.