Starting with Webix Jet 3.0, the toolchain has been migrated to Vite. Read more about it here. There are some differences from usage with WebPack:
APPNAME=Demo
VERSION=1.0.0
BUILD_AS_MODULE=false
// app.js
const defaults = {
id : import.meta.env.APPNAME,
version : import.meta.env.VERSION,
router : import.meta.env.BUILD_AS_MODULE ? EmptyRouter : HashRouter,
debug : !import.meta.env.PROD,
// ...
};
...
if (!import.meta.env.BUILD_AS_MODULE){
webix.ready(() => new MyApp().render() );
}
// app.js
// dynamic import of views
const modules = import.meta.glob("./views/**/*.js");
const views = name => modules[`./views/${name}.js`]().then(x => x.default);
export default class MyApp extends JetApp{
constructor(config){
const defaults = {
// ...
views,
}
}
}
// app.js
const locales = import.meta.glob("./locales/*.js");
const words = name => locales[`./locales/${name}.js`]().then(x => x.default);
...
export default class MyApp extends JetApp{
constructor(config){
//...
// patch locales loader, optional
this.use(plugins.Locale, {
path: words,
storage: this.webix.storage.session
});
}
}
// package.json
"scripts": {
"build": "vite build",
"start": "vite"
}