Skip to content
Snippets Groups Projects
Commit c43537fc authored by Maki Nishifuji's avatar Maki Nishifuji
Browse files

Bugfix: Babel compile

parent 1c52051a
No related branches found
No related tags found
No related merge requests found
......@@ -91,7 +91,7 @@
<div class="title">
{{data.scriptError.name}}
</div>
<pre>{{data.scriptError.codeFrame}}</pre>
<pre>{{data.scriptError.message}}</pre>
</div>
{{/if}}
</div>
......
......@@ -109,7 +109,7 @@
<div class="title">
{{data.scriptError.name}}
</div>
<pre>{{data.scriptError.codeFrame}}</pre>
<pre>{{data.scriptError.message}}</pre>
</div>
{{/if}}
</div>
......
......@@ -23,14 +23,14 @@ Meteor.methods
if integration.scriptEnabled is true and integration.script? and integration.script.trim() isnt ''
try
babelOptions = Babel.getDefaultOptions()
babelOptions.externalHelpers = false
babelOptions = Babel.getDefaultOptions({ runtime: false })
babelOptions = _.extend(babelOptions, { compact: true, minified: true, comments: false })
integration.scriptCompiled = Babel.compile(integration.script, babelOptions).code
integration.scriptError = undefined
catch e
integration.scriptCompiled = undefined
integration.scriptError = _.pick e, 'name', 'message', 'pos', 'loc', 'codeFrame'
integration.scriptError = _.pick e, 'name', 'message', 'stack'
for channel in channels
record = undefined
......
......@@ -26,14 +26,14 @@ Meteor.methods
if integration.scriptEnabled is true and integration.script? and integration.script.trim() isnt ''
try
babelOptions = Babel.getDefaultOptions()
babelOptions.externalHelpers = false
babelOptions = Babel.getDefaultOptions({ runtime: false })
babelOptions = _.extend(babelOptions, { compact: true, minified: true, comments: false })
integration.scriptCompiled = Babel.compile(integration.script, babelOptions).code
integration.scriptError = undefined
catch e
integration.scriptCompiled = undefined
integration.scriptError = _.pick e, 'name', 'message', 'pos', 'loc', 'codeFrame'
integration.scriptError = _.pick e, 'name', 'message', 'stack'
for channel in channels
record = undefined
......
......@@ -40,14 +40,14 @@ Meteor.methods
if integration.scriptEnabled is true and integration.script? and integration.script.trim() isnt ''
try
babelOptions = Babel.getDefaultOptions()
babelOptions.externalHelpers = false
babelOptions = Babel.getDefaultOptions({ runtime: false })
babelOptions = _.extend(babelOptions, { compact: true, minified: true, comments: false })
integration.scriptCompiled = Babel.compile(integration.script, babelOptions).code
integration.scriptError = undefined
catch e
integration.scriptCompiled = undefined
integration.scriptError = _.pick e, 'name', 'message', 'pos', 'loc', 'codeFrame'
integration.scriptError = _.pick e, 'name', 'message', 'stack'
for channel in channels
......
......@@ -52,14 +52,14 @@ Meteor.methods
if integration.scriptEnabled is true and integration.script? and integration.script.trim() isnt ''
try
babelOptions = Babel.getDefaultOptions()
babelOptions.externalHelpers = false
babelOptions = Babel.getDefaultOptions({ runtime: false })
babelOptions = _.extend(babelOptions, { compact: true, minified: true, comments: false })
integration.scriptCompiled = Babel.compile(integration.script, babelOptions).code
integration.scriptError = undefined
catch e
integration.scriptCompiled = undefined
integration.scriptError = _.pick e, 'name', 'message', 'pos', 'loc', 'codeFrame'
integration.scriptError = _.pick e, 'name', 'message', 'stack',
for channel in channels
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment