How to use Angular-CLI with NativeScript
2 min readJul 10, 2017
The Angular CLI is a great tool that allows you to do things like ‘generate’ files and ‘serve’ your web apps to a local server. However, this tool does not work in NativeScript apps without a little configuration. This post will show you how to get things set up to start generating files in your NativeScript projects.
Step 1: Run npm install -g @angular-cli
inside your terminal.
Step 2: Create a file called .angular-cli.json
in the root of your project.
Step 3: Paste this code into the file:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"version": "1.0.0-beta.32.3",
"name": "testproj"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"styles": [
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"files": "src/**/*.ts",
"project": "src/tsconfig.json"
},
{
"files": "e2e/**/*.ts",
"project": "e2e/tsconfig.json"
}
],
"test": {…