Currently contents can contain up to 100MB of files in the watched directory (typically
/home/nt-user/workspace). If there are large files in a content that a user will not need to edit, the following steps can be taken to add them to the content:
Create a content using the Creator.
Add the names of the large files or folders in the Excluded Files Patterns list as shown in the image below. Note that multiple entries should be separated by newlines and the
* wildcard character is supported.
Create a compressed archive of the files that were added in the Excluded Files Patterns.
tar -czvf node_modules.tgz /home/nt-user/workspace/hello-world/node_modules
Upload the archive to a cloud storage provider such as AWS S3 or Google Storage. Uploading it to a public GitHub repository also works.
Add a startup script to download and extract the archive into the content. An example of a possible startup script is as follows (click here for more information on adding startup scripts):
wget -q -O /tmp/node_modules.tgz https://example.com/node_modules.tgzmkdir -p /home/nt-user/workspace/hello-world/node_modules/tar -xzf /tmp/node_modules.tgz --directory /home/nt-user/workspace/hello-world/node_modules/ --strip-components=1rm -f /tmp/node_modules.tgz
wget to download the compressed node_modules.tgz file to the /tmp directory. Next it ensures the destination folder exists. Then it extracts the compressed files to the desired folder. Finally it removes the archive that was downloaded to the /tmp directory.
That's it! The large files will now be downloaded to the content each time it is launched.