rsnext/lib/eval-script.js

19 lines
569 B
JavaScript
Raw Normal View History

2016-10-06 01:52:50 +02:00
/**
* IMPORTANT: This module is compiled *without* `use strict`
* so that when we `eval` a dependency below, we don't enforce
* `use strict` implicitly.
*
* Otherwise, modules like `d3` get `eval`d and forced into
* `use strict` where they don't work (at least in current versions)
*
2017-02-12 17:32:45 +01:00
* To see the compilation details, look at `flyfile.js` and the
2016-10-06 01:52:50 +02:00
* usage of `babel-plugin-transform-remove-strict-mode`.
*/
export default function evalScript (script) {
const module = { exports: {} }
2016-10-06 01:52:50 +02:00
eval(script) // eslint-disable-line no-eval
return module.exports
}