jspm / jQuery / TypeScript – 模块“jquery”没有默认导出

我正在尝试使用TypeScript和jspm&system.js来引导Web应用程序以进行模块加载。 我不是很远。 安装jspm后,用它来安装jQuery:

jspm install jquery 

基础知识:

    System.import('main');  

main.ts:

 import $ from "jquery"; export class Application { constructor() { console.log($); } } 

TypeScript将无法编译,因为“Module’jquery’没有默认导出。

生成的config.js具有正确的映射:“jquery”:“npm:jquery@2.2.0”

当模块没有默认导出时,您可以将完整模块作为对象import * as $ from "jquery";import * as $ from "jquery";

import { ajax, css } from "jquery";导入命名导出: import { ajax, css } from "jquery";

如果您使用的是visual studio ,请更新typescript插件。

要获得2017年Visual Studio的最新版本, 请去那里