Skip to content

Commit

Permalink
[core] Fix missing dependencies for 'sanity exec' command
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Feb 5, 2018
1 parent 108c3c3 commit 219bba9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/@sanity/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"@sanity/resolver": "0.125.0",
"@sanity/server": "^0.125.3",
"@sanity/util": "0.125.0",
"babel-preset-env": "^1.6.1",
"babel-register": "^6.26.0",
"batch-stream-operation": "^1.0.2",
"debug": "^3.1.0",
"deep-sort-object": "^1.0.1",
Expand Down
15 changes: 12 additions & 3 deletions packages/@sanity/core/src/actions/exec/babel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
const presets = ['es2015-node4', 'stage-2']
import registerBabel from 'babel-register'

require('babel-register')({
presets: presets.map(preset => require.resolve(`babel-preset-${preset}`)),
registerBabel({
presets: [
[
'env',
{
targets: {
node: 'current'
}
}
]
]
})

0 comments on commit 219bba9

Please sign in to comment.