Updated on 2023-12-21 GMT+08:00

Using YAML to Configure a Yarn Build

version: 2.0 # The value must be 2.0.
steps:
  BUILD:
	- yarn:
       inputs:
          command: |-
	#If the Node.js version is earlier than 18, the settings can be as follows:
			npm config set cache-folder /yarncache
			npm config set registry http://mirrors.tools.huawei.com/npm/
			npm config set disturl http://mirrors.tools.huawei.com/nodejs
			npm config set sass_binary_site http://mirrors.tools.huawei.com/node-sass/
			npm config set phantomjs_cdnurl http://mirrors.tools.huawei.com/phantomjs
			npm config set chromedriver_cdnurl http://mirrors.tools.huawei.com/chromedriver
			npm config set operadriver_cdnurl http://mirrors.tools.huawei.com/operadriver
			npm config set electron_mirror http://mirrors.tools.huawei.com/electron/
			npm config set python_mirror http://mirrors.tools.huawei.com/python
			
			#If the Node.js version is 18 or later, the settings can be as follows:
			 #npm config set registry http://mirrors.tools.huawei.com/npm/ 
			 npm config set prefix '~/.npm-global'
			export PATH=$PATH:~/.npm-global/bin
			#yarn add node-sass-import --verbose
			yarn install --verbose
			yarn run build
			tar -zcvf demo.tar.gz ./**

Parameter

Type

Description

Mandatory

Default Value

command

string

Execute commands.

Yes

None