Vue CLI or Native-CLI, what is the recommended way to start a new project?


#1

I’m new to NativeScript. Especially now there’s the new Vue CLI 3, what is the recommended way to generate a new project? What template? Does it matter?


#2

You will have to install both but to start a new project use the starter templates.


#3

I too would like to know the recommended approach here.

For a NativeScript-Vue project should we go the TNS (with great VSCode debugging support) or the Vue CLI route?

Which route is the teams suggested?


#4

Vue is still at early stage, I don’t think you can directly run Vue project with TNS or VSCode it must go through the Vue CLI as TNS won’t know how to compile it.


#5

There sure is confusion here. I have installed both a Vue CLI and the other a TNS based Vue template from here

https://nativescript-vue.org/en/docs/getting-started/templates/

They are fundamentally different. One uses NPM (Vue CLI) and one uses TNS what I need to know is which is the best option going forward? Also if I use the Vue CLI template do I loose the great debugging support in VSCode?

TNS

tns create <project-name> --template nativescript-vue-template
$ cd <project-name>
$ tns run android
$ # or
$ tns run ios

VUE CLI / NPM

$ npm install -g @vue/cli @vue/cli-init
$ vue init nativescript-vue/vue-cli-template <project-name>
$ cd <project-name>
$ npm install
$ npm run watch:android
$ # or
$ npm run watch:ios

#6

As you could read in the docs, if you prefer a complete Vue experience (.vue files, Vue Router, Vuex) which usually a choice for most people from Vue background, then you must go with Vue CLI & NPM commands as TNS won’t understand what those are.

If you go with NativeScript Vue template which is simple JavaScript then TNS would understand that, no need for Vue CLI. Since TNS understands this, VSCode plugin should too.