I am using angular-cli@webpack.
I have configured my node services using gulp and to run my json-server I am executing my gulpfile:
var gulp = require('gulp');
var gulpif = require('gulp-if');
var server = require('gulp-express');
var args = require('yargs').argv;
var typescript=require('gulp-typescript');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');
var tsconfig = typescript.createProject('src/tsconfig.json');
gulp.task('default',function(){
// Start the server at the beginning of the task
console.log('Start the server at the beginning of the task');
server.run(['server/json-server-starter.js']);
});
Now for running my angular2 project I am using npm start .
I want to have a functionality that after angular-cli completes bundling of my app , json-server should be started.
I have tried including below command in package.json :
"scripts": {
"start": "ng serve && gulp",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
}
But it doesnt run the gulpfile after bundling the app.
If I include gulp before ng serve then only gulpfile runs, webpack doesnt run the angular2 application.
So is there any way I can run both tasks simultaneously?
any inputs?
thanks in advance.
(ng serve &) && gulp.