NativeScript uses a MVVM pattern for project development just like on objective-c or java that used for their development process, and if the project/app become bigger and complex, you need a good folder structure and one of the official (source) suggest us to use folder structure like so:
Of course you could just make it manually, but there is a way which is more elegant and modern by using Grunt, one of popular npm module. Actually this process is also can be the start for preparing the node module if you want use it to ease your development.
- Install Nodejs (this should be done if you already try NativeScript).
- And then, go to you project folder using command-line, for example TODO project
package.jsonby type this command
npm initdan then
npm install -g grunt-cli
npm install grunt --save-dev
npm install grunt-build-dir --save-dev
Gruntfile.jsfile to run grunt task on your local project and copy paste the code below:
- Lastly, run
grunton command-line, dan Yeayy!! the folder structure has automatically created for you.