# Replace gulp task with Ionic app scripts

**URL:** <https://forum.ionicframework.com/t/replace-gulp-task-with-ionic-app-scripts/129140>\
**Category:** ionic-v3\
**Created:** [April 27, 2018, 1:04pm UTC](https://forum.ionicframework.com/t/replace-gulp-task-with-ionic-app-scripts/129140 "2018-04-27T13:04:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgopawat](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rgopawat/32/119074_2.png) [@rgopawat](https://forum.ionicframework.com/u/rgopawat)\
**Post date:** [April 27, 2018, 1:04pm UTC](https://forum.ionicframework.com/t/replace-gulp-task-with-ionic-app-scripts/129140/1 "2018-04-27T13:04:41Z")

</div>

Hi All,

I have a gulpfile.js with a default function and which accepts a argument. (for eg. gulp --country IN).  
Gulp function takes that parameter name, copies some folders and files of the passed argument deletes them, modify json data and move it into some other folder. **So basically, I used 3 gulp tasks (gulp-param, gulp-clean, gulp-json-modify).**

And then after that I run ionic serve. I want to know if I can run ionic serve with a paramter or write a new command that runs the gulp code first (we can replace it with ionic app scripts) and then runs the ionic serve command.

**In short, I want to run one command instead of 2 but still solves the purpose**

---

<div class="post-metadata">

**Author:** ![AaronSterling](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AaronSterling](https://forum.ionicframework.com/u/AaronSterling)\
**Post date:** [April 27, 2018, 1:10pm UTC](https://forum.ionicframework.com/t/replace-gulp-task-with-ionic-app-scripts/129140/2 "2018-04-27T13:10:28Z")

</div>

> [@rgopawat](#):
>
> write a new command that runs the gulp code first (we can replace it with ionic app scripts) and then runs the ionic serve command

If I understand correctly, then yes, it’s pretty simple. But be sure to read the best practices section here: [https://docs.npmjs.com/misc/scripts](https://docs.npmjs.com/misc/scripts)

---

<div class="post-metadata">

**Author:** ![rgopawat](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rgopawat/32/119074_2.png) [@rgopawat](https://forum.ionicframework.com/u/rgopawat)\
**Post date:** [April 27, 2018, 1:28pm UTC](https://forum.ionicframework.com/t/replace-gulp-task-with-ionic-app-scripts/129140/3 "2018-04-27T13:28:24Z")

</div>

Do you have some examples or some code snippets of the same for me to start with?

---

<div class="post-metadata">

**Author:** ![AaronSterling](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AaronSterling](https://forum.ionicframework.com/u/AaronSterling)\
**Post date:** [April 27, 2018, 3:07pm UTC](https://forum.ionicframework.com/t/replace-gulp-task-with-ionic-app-scripts/129140/4 "2018-04-27T15:07:02Z")

</div>

You can probably just use `&&`, but here’s more discussion about replacing gulp scripts by npm scripts.

> **[Why I Left Gulp and Grunt for npm Scripts – freeCodeCamp](https://medium.freecodecamp.org/why-i-left-gulp-and-grunt-for-npm-scripts-3d6853dd22b8?gi=6ab53086ba06)**
>
> I know what you’re thinking. WAT?! Didn’t Gulp just kill Grunt? Why can’t we just be content for a few minutes here in JavaScript land? I…

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:38pm UTC](https://forum.ionicframework.com/t/replace-gulp-task-with-ionic-app-scripts/129140/5 "2021-07-19T21:38:26Z")

</div>


