Skip to content

Commit

Permalink
fix(babel): Only use sourceType unambiguous for browsers (seek-oss#326)
Browse files Browse the repository at this point in the history
This fixes an issue where flow prop-type generation would break when running in a node context. e.g. jest.
  • Loading branch information
mattcompiles authored Feb 26, 2019
1 parent cc6b402 commit 4207d50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/babel/babelConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = ({ target, lang = 'js' }) => {

return {
babelrc: false,
sourceType: 'unambiguous',
sourceType: isBrowser ? 'unambiguous' : 'module',
presets: [
languagePreset,
[require.resolve('@babel/preset-env'), envPresetOptions],
Expand Down

0 comments on commit 4207d50

Please sign in to comment.