Answer the question
In order to leave comments, you need to log in
How to rebuild only modified Angular 2 and Cordova files for live development?
Did the following:
cd Projects
ng new App
cd App
npm install nodemon --save-dev
cordova create cordova com.company.app "App"
cd cordova
cordova platform add browser
{
"name": "App",
"version": "0.0.0",
"scripts": {
"ng:build": "ng build --target=production --environment=prod --output-path=cordova/www/",
"build:browser": "npm run ng:build && cd cordova && cordova build browser",
"build:android": "npm run ng:build && cd cordova && cordova build android",
"dev:browser": "cd cordova && cordova run browser && nodemon --exec \"npm run ng:build\" -- ./src",
"dev:android": "cd cordova && cordova run android && nodemon --exec \"npm run ng:build\" -- ./src"
},
"dependencies": {
...
},
"devDependencies": {
...
"nodemon": "^1.11.0"
}
}
cd ..
npm run dev:browser
"ng:build": "ng build --target=production --environment=prod --output-path=cordova/www/",
"build:browser": "npm run ng:build && cd cordova && cordova build browser",
"build:android": "npm run ng:build && cd cordova && cordova build android",
"dev:browser": "nodemon --exec \"npm run ng:build && cd cordova && cordova run browser\"",
"dev:android": "nodemon --exec \"npm run ng:build && cd cordova && cordova run android\""
Answer the question
In order to leave comments, you need to log in
npm i -g @angular/cli cordova phonegap
cd %userprofile%\Documents\Projects
ng new App
cd App
cordova create cordova com.mycompany.appid "App"
cd cordova
cordova platform add browser
cd ..
{
"name": "App",
"version": "0.0.0",
"scripts": {
"start:ng:open": "ng serve --open",
"start:ng:www": "ng serve --host 0.0.0.0 --public my.public.domain",
"start:ng": "rmdir-cli cordova/www/ && ng build --output-path=cordova/www/ --watch",
"start:cordova:serve": "cd cordova && mkdirp www && phonegap serve",
"start:cordova:run": "cd cordova && mkdirp www && cordova run android",
"start": "concurrently --kill-others \"npm run start:cordova:serve\" \"npm run start:ng\""
},
"devDependencies": {
"concurrently": "^3.4.0",
"rmdir-cli": "^2.0.6",
"mkdirp": "^0.5.1",
...
}
...
}
npm i
npm run start
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question