我试图用一串es6代码创建一个SystemJS模块(我知道......但我已经了解了我的理由)。我该怎么做呢?
例如,配置看起来像:
System.config({
paths: {
'jquery': "https://code.jquery.com/jquery-3.2.1.min.js",
},
transpiler: 'plugin-babel',
meta: { ...
我试图
const javascriptString = `
import $ from 'jquery';
export function doSomething() {
...
};
`;
System.module(javascriptString)
.then(m => {
m.doSomething();
});
我确实看到了System.module
方法的一些(标注日期?)引用:here和here。但这似乎并不是由SystemJS实现的。
我怎么能这样做呢?
感谢。