Using TypeScript
Last updated
// tsconfig.json
{
...
"files":[
"node_modules/webix/webix.d.ts"
]
}// tsconfig.json
{
...
"include":[
"sources/**/*.ts"
]
}// webpack.config.js
const config = {
entry: "./sources/myapp.ts",
...
resolve: {
extensions: [".ts", ".js"],
...
}
}// webpack.config.js
const config = {
...
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader"
},
...
]
}
}// package.json
"devDependencies": {
...
"ts-loader": "^3.2.0",
"tslint": "^5.9.1",
"typescript": "^2.6.2",
...
},
"dependencies": {
"webix-jet": "^1.3.7"
}// sources/app.ts
import {JetApp} from "webix-jet";
import "./styles/app.css";
declare var APPNAME;
declare var VERSION;
webix.ready(() => {
const app = new JetApp({
id: APPNAME,
version: VERSION,
start: "/top/start"
});
app.render();
});"scripts": {
"lint": "tslint -p tsconfig.json",
...
}