Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typescript requirejs web essentials 2.9

I just update Web essentials and Typescript to new version.

Result that my project don't work anymore.

Here's my typescript code:

/// <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 {

Before update my generated code (that worked) was:

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);

    }

Now it look-like:

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);

In my console I have this error:

Uncaught Error: Module name "Common" has not been loaded yet for context: _. Use require([])

I try to add Common in the config. But before update It s just working fine.

Anyone can help me, maybe something need to be change in my code to have back my project working.

Thanks,

Jérôme

UPDATE

I just see that is due to Web Essentials 2.9, I don't have anymore the option to specify compiler option for amd module.

I just remove the extension and install back the version 2.7:

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

like image 497
Jerome2606 Avatar asked Aug 05 '13 21:08

Jerome2606


1 Answers

I would just add to this that Web Essentials does indeed support AMD modules in version 2.8 but that the option has gone missing in 2.9 - check out the comments on the download page.

You'll find the setting (in 2.8 or below) in...

Tools > Options > Web Essentials > TypeScript > "Use the AMD module"

Web Essentials TypeScript Options

like image 163
Fenton Avatar answered Sep 21 '22 18:09

Fenton