I'm encountering an issue with gulp in my project. I've set up a process to automate the compilation of source and styles into a single file using gulp. However, I'm facing a problem where it doesn't want to overwrite the `application.js` file created from all `.js` files in my project. Interestingly, it does overwrite the compiled CSS files generated from all `.less` files in the project. Here is an overview of my project file structure:
.
├── gulpfile.js
└── apps
├── base
├── controllers
├── controllerBaseOne.js
└── controllerBaseTwo.js
├── directives
├── directiveBaseOne.js
└── directiveBaseTwo.js
├── services
└── serviceBaseOne.js
└── styles
└── styleBase.less
├── header.html
└── index.html
├── services
├── compilation
├── application.js
└── application.css
├── controllers
├── controllerServicesOne.js
├── controllerServicesTwo.js
└── controllerServicesThree.js
├── directives
├── directiveServicesOne.js
├── directiveServicesTwo.js
└── directiveServicesThree.js
├── services
├── serviceServicesOne.js
└── serviceServicesTwo.js
└── styles
├── styleServicesOne.less
├── styleServicesTwo.less
└── styleServicesThree.less
├── header.html
└── index.html
├── appMain.js
└── config.json
Below is how my current `gulpfile.js` is configured:
// Your unique configuration goes here...
In my `gulpfile.js`, the task `services-source` concatenates all `.js` files in the `apps` folder and sub-folders into a single file named `application.js` which is then placed in the `compilation` folder. Similarly, the `services-styles` task performs some less transformation on the styles before placing them in the same `compilation` folder. Minification of both sources and styles is also possible but disabled by default.
I attempted to resolve the overwriting issue by adding an `overwrite: true` parameter at the end of the `services-source` task for the destination of the compiled file, but it didn't seem to work. When running the `gulpfile.js`, the `application.js` file just keeps getting larger without overwriting. Any suggestions on what might be causing this problem?