Current working directory is not a Cordova-based project.
humblecoder last edited by
I’m trying to add Cordova plugins to my project. Why, (when init-ing a project via vue-cli ) does my supposedly pre-configured Cordova app, not think it’s a Cordova app? Obviously it’s missing relevant files, but what is the “template” supposed to be if not Cordova-based? Also, what is the recommended mechanism for making it so besides “starting over”? :confounded:
@humblecoder Do you mean with Monaca? I think it’s looking for
wwwfolder, so simply run
npm run buildto generate it. I think I’ll need to add an empty
wwwto the template to avoid this :sweat_smile:
humblecoder last edited by humblecoder
@Fran-Diox well, the instruction says “vue-cordova-webpack” so my assumption was that we could use “pure” cordova. That said, running
npm run buildcreated the
wwwfolder, but I still can’t successfully run any other commands such as
monaca previewwithout an error such as
Failed serving project: Cannot read property 'build' of null.
Not to sound too obtuse, but it would be nice to have a “super obvious” A-Z presentation of how to create a project from scratch (without templates, etc.). Or, perhaps you do and I’ve simply missed it. :expressionless:
@humblecoder You should be able to use “pure” cordova, indeed. But then, you are trying to run Monaca commands here, right? There is a Monaca guide here for this specific template. This link (and more info) is shown in the terminal right after
vue init OnsenUI/vue-cordova-webpackcommand finishes but I guess you didn’t see it.
Vue CLI templates are a bit different from the rest of Monaca templates, so instead of
monaca previewyou’ll need to run
npm run dev(it’s how Vue CLI templates work by default). I think all the necessary stuff is explained in that guide anyway :thumbsup:
For creating projects without templates, well, you basically need to know how to create a Vue project. Onsen UI is just a plugin for it and you can see how to include it in the docs. After that, if you want your Vue app to be Cordova-like, have a look at their project structure guide. The most important things are
wwwfolder (with all the public files). The rest is using Cordova CLI to add platforms and plugins, or Monaca CLI.
Therefore, what the templates provide is basically a Vue app with Onsen UI imported and a config.xml file. The build process has been also a bit changed to produce a
wwwfolder instead of the default
Edit: I just tried with Cordova CLI and the problem is the same, it simply needs
wwwso you need to run
npm run build.