7

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.

2
  • 1
    Try (ng serve &) && gulp. Commented Sep 12, 2016 at 7:14
  • @SvenSchoenung Tried this, no success Commented Sep 12, 2016 at 7:28

1 Answer 1

11

Finally I found one solution for this on windows.

it states that using below command in package.json can run both gulp & webpack simultaneously:

"start": "start ng serve && start gulp"

Thanks for the response.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.