I'm using TypeScript in VS2015, and trying to import the knockout module in some other module. Knockout is installed to a path other than "/knockout", in fact, all my "libraries" are installed to "/app/lib". As a result of the folder names not necessarily matching the module names, I've defined the following in my main.ts:
requirejs.config({
baseUrl: "/app",
paths: {
"text" : "lib/requirejs-text/text",
"durandal" : "lib/durandal/js",
"plugins" : "lib/durandal/js/plugins",
"transitions": "lib/durandal/js/transitions",
"knockout" : "lib/knockout.js/knockout",
"jquery" : "lib/jquery/jquery",
"bootstrap" : "lib/bootstrap-sass-official/javascript/bootstrap"
}
});
So my app at runtime can find knockout using just var ko = require("knockout").
However, at design time in visual studio, I get a "red squiggly" under my require() call:
I believe this is because VS is trying to use paths rather than my custom path configuration to look for Knockout. How then, can I tell VS about my custom path configuration so this works? At the moment the generated JavaScript is:
var receiveDeliveryViewModel = (function () {
function receiveDeliveryViewModel() {
this.deliveryReference = ("");
}
return receiveDeliveryViewModel;
})();
Which as you can see does not reference Knockout.js.
Many thanks in advance.
