In my application I have two main screens for two types of users and a login page. When a user opens the app I check what is the type of the user, and based on the user type I open a specific app-root.xml file.
app.js
let currentLogin = appSettings.getString("login", "nothing");
if (currentLogin === 'customer') {
application.run({ moduleName: "app-root-home" });
}
else if (currentLogin === 'shop') {
application.run({ moduleName: "app-root-shop" });
}
else {
application.run({ moduleName: "app-root" });
}
I have three different XML files in my app directory (app-root, app-root-home & app-root-shop). each of them has a different frame wrapped in different layouts.
When I execute without Webpack everything works fine, but when I enable Webpack from sidekick, if the following statement is executed application.run({ moduleName: "app-root-home" }); I receive an error: TypeError: Cannot read property '_domid' of undefined.
I tried to decompile the application and see the bundle.js file and I found that webpack didn't add app-root-home.xml nor app-root-shop.xml. Only app-root.xml was there.
I'm using nativescript sidekick and I'm building my project on cloud; I don't type command lines a lot, the cloud does that for me.
My nativescript-dev-webpack dev version is 0.19.0.
I'm developing in JS.
I tried to find a solution on github for similar issues like mine, and to be able to include xml files in the app directory, and all the solutions included modifications in bundle-config.js which I don't have in my project.
It looks like in new versions of webpack the bundle-config.js file doesn't exist anymore in the app directory, instead it exists in the same plugin folders. Reference
I only have webpack.config.js in my app directory, so I need to know to can I add the xml files to it in JS, but I couldn't find a way to do this.
How can I include all xml files in app directory in the latest version of webpack plugin to my application and run on sidekick.