- Install dependency in your project (started from ss-template)
npm i -D @brokenrubik/ss-build-tools@latest
Example package.json:
{
"scripts": {
"deploy": "ss-deploy",
"build": "ss-build",
"watch": "ss-watch"
}
}
The default TypeScript source path is set to "src/TypeScript"
. If you want to specify a different path you can either:
- Use the TS_SOURCE_PATH environment variable
- Use the
--source-path
command line argument
For example:
{
"scripts": {
"build": "ss-build --source-path src/ts-files"
}
}
The output of the build command will be be placed in the outDir
specified in your tsconfig.json
file.
We recomend setting the outDir
to "src/FileCabinet/SuiteScripts/<Project Name>"
.
You can pass the -js
flag to the build command to copy files from the src/SuiteScripts
directory to the src/FileCAbinet/SuiteScripts
directory.
Running the deploy command will automatically build, and pass the arguments. You can specify the source path in the same way as the build command.
The files in "src/FileCabinet/SuiteScripts"
will be deployed using suitecloud
commands.
Running the watch command will automatically build and deploy on file changes.
This is useful for development, but it is not recommended to use this in production.
The watch mode will incrementally build the TypeScript output, and deploy files that have changed.
You can specify the source path in the same way as the build command. The default is "src/TypeScript"
.
{
"scripts": {
"watch": "ss-watch --source-path src/TypeScript"
}
}
You can use the FILE_PATH
environment variable to prefix the project's dir.
For example, if you create a .env
file with:
FILE_PATH=my-custom-scripts
Then, only files under src/FileCabinet/SuiteScripts/my-custom-scripts
will be deployed.