Currently I am following official ts-ko demo. When I put a direct reference to Ko:
/// <reference path="./node_modules/@types/knockout/index.d.ts" />
There is no errors. But when a refrence is added in the following way:
import * as ko from "knockout";
an error is thrown:
Uncaught ReferenceError: require is not defined
Typescript demo states that:
We’ll need to grab Knockout itself, as well as something called RequireJS.
What is the right way to define RequireJs? Why it is required to use requirejs for "import" case?
package.json
"dependencies": {
"jquery": "3.1.1",
"@types/jquery": "2.0.33",
"knockout": "3.4.0",
"@types/knockout": "1.1.5"
}