Pass options to ES6 module imports

后端 未结 7 1138
[愿得一人]
[愿得一人] 2020-11-22 04:43

Is it possible to pass options to ES6 imports?

How do you translate this:

var x = require(\'module\')(someoptions);

to ES6?

相关标签:
7条回答
  • 2020-11-22 05:36

    I believe you can use es6 module loaders. http://babeljs.io/docs/learn-es6/

    System.import("lib/math").then(function(m) {
      m(youroptionshere);
    });
    
    0 讨论(0)
提交回复
热议问题