Skip to content

Commit

Permalink
Use ES modules in browser build
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Mar 7, 2020
1 parent 7acfb9a commit 14e4694
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const isBrowser = process.env.BABEL_ENV === 'browser'

const envOptions = { useBuiltIns: false }
if (!isBrowser) envOptions.targets = { node: '6.5' }
const envOptions = isBrowser
? { modules: false, useBuiltIns: false }
: { targets: { node: '6.5' }, useBuiltIns: false }
const presets = [['@babel/env', envOptions]]

const plugins = [
Expand Down

0 comments on commit 14e4694

Please sign in to comment.