gpt4 book ai didi

import - Typescript requirejs web essentials 2.9

转载 作者:搜寻专家 更新时间:2023-10-30 20:40:36 25 4
gpt4 key购买 nike

我只是将 Web essentials 和 Typescript 更新到新版本。

结果是我的项目不再工作了。

这是我的 typescript 代码:

/// <reference path="DefinitelyTyped/jqueryui.d.ts" />
/// <reference path="DefinitelyTyped/jquery-datatable.d.ts" />

import Common = module("Common");
import GMap = module("GMap");

declare var $: JQueryStatic;

export class Polygon extends GMap.Polygon {

在更新我生成的代码(有效)之前:

var __extends = this.__extends || function (d, b) {
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
define(["require", "exports", "GMap", "Common"], function(require, exports, __GMap__, __Common__) {
var GMap = __GMap__;

var Common = __Common__;

var Polygon = (function (_super) {
__extends(Polygon, _super);
function Polygon() {
_super.apply(this, arguments);

}

现在看起来像:

var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var Common = require("./Common");
var GMap = require("./GMap");

var Polygon = (function (_super) {
__extends(Polygon, _super);

在我的控制台中我有这个错误:

Uncaught Error :尚未为上下文加载模块名称“Common”:_。使用 require([])

我尝试在配置中添加 Common。但在更新之前它工作正常。

任何人都可以帮助我,也许需要更改我的代码才能使我的项目正常运行。

谢谢,

杰罗姆

更新

我只是看到这是由于 Web Essentials 2.9,我不再有为 amd 模块指定编译器选项的选项。

我只是删除扩展并安装回 2.7 版:

http://vswebessentials.com/nightly/webessentials2012-2.7.vsix

最佳答案

我只想补充一点,Web Essentials 在 2.8 版中确实支持 AMD 模块,但在 2.9 版中该选项已丢失 - check out the comments on the download page .

你会在...中找到设置(在 2.8 或更低版本中)

工具 > 选项 > Web Essentials > TypeScript >“使用 AMD 模块”

Web Essentials TypeScript Options

关于import - Typescript requirejs web essentials 2.9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18067754/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com