Ignore Lightning Application with .forceignore

Using SalesforceDX, I am currently having trouble finding a way to ignore a lightning application created in my scratch org; the force:source:status always seem to include it.

The name of the Aura bundle is “preview” and the current .forceignore file read this :

package.xml
preview\preview.app
preview
**preview

The file is placed at the root of the project and works fine when I try to ignore other files such as a given object or profile. But when it comes to AuraDefinitionBundle, I am having trouble finding out the right exclusion syntax. As seen above, I tried to exclude the app file which is the name that the force:source:status command return me for the application, the folder name or any folder with that name.

Nothing seems to work and I figured it might be rather simple but I am missing it and the documentation on this seems limited on salesforce side. I tried a bunch of other things from related .gitignore doc but without success.

Answer

I’ve had great trouble getting my head round the various forceignore syntaxes.
As of now (my version is sfdx-cli/7.48.0-a71f8c6899) the following is what I’ve found for Aura Definition Bundle entries (note I’m unsure why the OP’s preview entry did not work);

  • You don’t need to supply an extension (unlike the other meta)
  • Be careful that the entries have implicit wild carding.

An example;
If my sfdx force:source:status return this;

STATE       FULL NAME              TYPE                  PROJECT PATH
──────────  ─────────────────────  ────────────────────  ────────────
Remote Add  setExpId/setExpId.evt  AuraDefinitionBundle

Then I can ignore that setExpId bundle with this entry in the .forceignore;

setExpId

Attribution
Source : Link , Question Author : P. Lapointe , Answer Author : Todd Halfpenny

Leave a Comment