I have gulpfile.js in React App.
In Azure Pipeline , I have 3 tasks
displayName: Run gulp
inputs:
gulpFile: ${{parameters.gulpFilePath}}
targets:
arguments: 'production'
gulpjs: 'node_modules/gulp/bin/gulp.js'
enableCodeCoverage: false
But here I am getting below error
I followed from stackoverflow as well
But not able to understand where I have to add this line of code in my gulp task --max_old_space_size=4096
I tried to add few different way but its always fail. I also passed in script liked below
task: PowerShell@2
displayName: Run npm install
inputs:
targetType: 'inline'
script: |
cd ${{parameters.reactAppPath}}
npm install
gulp --max_old_space_size=4096 --gulpfile ${{parameters.gulpFilePath}} production
Please help me Thank you for all your help
No gulp file found error occurs when your Pipeline is not able to find the gulpfile.js in your repository.
My Reactapp repository with gulpfile.js:-
My Azure yaml code to install and run gulp:-
I have added the file path to my gulpfile.js and react app in variable and then referenced it later in Run gulp task like below:-
variables:
gulpFilePath: '$(System.DefaultWorkingDirectory)/gulpfile.js'
reactAppPath: '$(System.DefaultWorkingDirectory)'
.
.
.
.. cd $(reactAppPath)
node --max_old_space_size=4096 ./node_modules/gulp/bin/gulp.js --gulpfile $(gulpFilePath)
Complete yaml code:-
trigger:
- '*'
pr:
- '*'
pool:
vmImage: 'ubuntu-latest'
variables:
gulpFilePath: '$(System.DefaultWorkingDirectory)/gulpfile.js'
reactAppPath: '$(System.DefaultWorkingDirectory)'
steps:
- task: UseNode@1
displayName: 'Install Node.js'
inputs:
version: '18.x'
- script: npm install -g npm@latest
displayName: 'Upgrade npm'
- script: npm install -g timers-promises
displayName: 'Upgrade npm'
- script: npm install --save-dev gulp gulp-babel gulp-browserify gulp-plumber gulp-sourcemaps babelify vinyl-source-stream
displayName: 'Upgrade npm'
# - script: npm install --global gulp
# displayName: 'Install Gulp globally'
- task: PowerShell@2
displayName: 'Run npm install'
inputs:
targetType: 'inline'
script: |
cd $(reactAppPath)
npm install
- task: PowerShell@2
displayName: 'Run Gulp'
inputs:
targetType: 'inline'
script: |
cd $(reactAppPath)
node --max_old_space_size=4096 ./node_modules/gulp/bin/gulp.js --gulpfile $(gulpFilePath)
Output:-