Excluding files from OCMS on build - tsgrp/HPI GitHub Wiki

When building and deploying OCMS you have the option to exclude files, here are instructions on how to do this and some tips on what to look out for.

How to exclude files

To exclude files you will need to add a filesToExclude property in your environment JSON file. This property should contain an array of file paths that you want to exclude. Here is an example: "filesToExclude" : [ "!app/modules/actions/controlledprint/**", "!app/templates/actions/controlledprint/**", "!app/modules/actions/softdeletedocument.js", "!app/templates/actions/softdeletedocument.html" ]

In this example we are removing files in two different ways:

  • By a general path !app/modules/actions/controlledprint/**
    • This will exclude ALL files that are under this path
  • A specific file !app/modules/actions/softdeletedocument.js

Things to look out for

  • If removing an action you will need to also remove that action from the config-action.js file
  • When removing a file you will need to exclude ALL files that reference that file