[F7-cli] Cordova / Browser quirks

I have a PWA for iOS, Android and Cordova.

If I add browser as target, the generated www folder (inside the built packages) still contains the cordova files, although I have this in the source- index.html

<% if (process.env.TARGET === 'cordova') { %>
  <script src="cordova.js"></script>
<% } %>

So, I suspect, the project is only built once and then copied? How can I circumvent this?

And here’s another (minor) thing: If I create a project (e.g. also adding electron) and remove a target, the build-scripts (e.g. build-dev-electron are still present in package.json.)

What do you mean, what is still cordova related there?

Build scripts created only once on project creation, feel free to modify them on your needs

What do you mean, what is still cordova related there?

On target ‘browser’, the index.html contains all the scripts to cordova.js etc… So it throws, when I try to run it and I first have to remove those references manually…

how do you add/enable this target?

Just as normal:

framework7 cordova platform add browser

But this is totally different thing. This is a Cordova’s browser platform which is still a part of cordova and require cordova’s assets. That target referenced in index.html is a Node.js ENV variable and it is set by npm script in main package.json

Exactly - that’s what I’m saying. You can try yourself: Just add a ‘browser’ target and try to run it… for me it didn’t work… It’s just confusing, if you create a project for Cordova-ios, -android and the browser (e.g. a PWA with Cordova support). I’d expect (at least) the builds to create the proper code. It might be that I’m looking from a false perspective, though. But I wanted to bring it at least to your attention. (it’s not a big deal anyway, just a matter of detail)

When we choose Web App (or PWA) in Framework7 CLI, it is not the same as cordova browser platform/target. It is a separate thing. Cordova’s browser platform will use cordova assets because it is related and handled by Cordova.