[英]What is the correct syntax for importing JSNLog using ES6?
I can't seem to figure out how to import JSNLog into my ES6 (babel) based Aurelia project. 我似乎无法弄清楚如何将JSNLog导入我的基于Aurelia项目的ES6(babel)。 I've tried: 我试过了:
import 'jsnlog'; // JL is undefined
import JL from 'jsnlog'; // JL is {}
import {JL} from 'jsnlog'; // JL is undefined
If it matters I've learned that the jsnlog.js file is generated from typescript source. 如果重要的话我已经知道jsnlog.js文件是从typescript源生成的。
I am the author of JSNLog. 我是JSNLog的作者。
Just added info to the jsnlog.com site about using ES6 import to import JSNLog into an ES6 NodeJs application: http://jsnlog.com/Documentation/HowTo/LoadingJsFile#es6 (using Babel as the transpiler). 刚刚向jsnlog.com网站添加了关于使用ES6导入将JSNLog导入ES6 NodeJs应用程序的信息: http ://jsnlog.com/Documentation/HowTo/LoadingJsFile#es6(使用Babel作为转换器)。
This uses: 这用于:
import {JL} from 'jsnlog';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.