https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/javascript-accessing-0000001051147976,
as this guide say I need put the following into main.js,but we dont have one:
// TODO: Replace the following code with the configuration of your app.
const agConnectConfig = {
// ...
};
// Configure the AppGallery Connect instance.
agconnect.instance().configInstance(agConnectConfig);
// Initialize the Analytics Kit instance.
let analytics = agconnect.analytics();
try to wrap this as a .astro file and import to basehead.astro like this,
import agconnect from "@agconnect/api"
import "@agconnect/instance"
import "@hw-hmscore/analytics-web"
export default function HuaWeiAnalytics() {
.........
}
tell me Cannot use import statement outside a module