Skip to main content

.genezioignore

.genezioignore is a feature that allows you to specify files and directories that you want to ignore when you build your project using genezio.

.genezioignore lets you ignore files and directories when you use genezio deploy and genezio local.

Usage

To use it, create a file named .genezioignore in the same folder as your yaml project configuration. In this file, you can specify files and directories you want to ignore by adding their names or paths, one per line. You can also use wildcards to ignore files and directories matching a pattern.

For example, if you want to ignore all files with the .txt extension, you can add the following line to your .genezioignore file:

*.txt

If you want to ignore all files and directories inside a directory named node_modules, you can add the following line:

node_modules/

Note that the trailing slash is significant, as it tells genezio to ignore the entire directory, not just a file with that name.

Syntax

Here are some rules to keep in mind when using .genezioignore:

  • Blank lines and lines that start with # are ignored, so you can use them to add comments or separate different sections of your .genezioignore file.
  • You can use * to match any sequence of characters within a filename or directory name. For example, *.js will match all files with the .js extension.
  • You can use ** to match any sequence of characters, including slashes, within a filename or directory name. For example, node_modules/** will match all files and directories inside any node_modules directory.
  • You can use ! to negate a pattern. For example, !*.js will match all files that do not have the .js extension.

When to use it

.genezioignore should be used when you want to exclude certain files or directories from your genezio bundling process. This can be useful in a number of scenarios, including:

  1. Ignoring build artifacts: If you have files that are generated during the build process (such as minified JavaScript or compiled CSS), you may want to exclude them from the genezio build to keep your repository clean.
  2. Ignoring test data: If you have large test data files that are not needed for the genezio build, you can exclude them to reduce the size of your repository.
  3. Ignoring temporary files: If you have temporary files or directories that are created during development, you can exclude them from the genezio build to reduce the amount of unnecessary data that needs to be built.
  4. Ignoring third-party code: If you are using third-party libraries or frameworks that are already included in the genezio build, you can exclude them from your bundle to reduce the amount of redundant code.

In general, the goal of using .genezioignore is to keep your bundle clean and avoid including unnecessary files in your genezio builds. By excluding these files, you can reduce the size of your bundles, make your builds faster, more efficient, and with less money.

Conclusion

With .genezioignore, you can easily customize which files and directories are included in your genezio builds. By using the .genezioignore file, you can keep your project clean and avoid cluttering your builds with unnecessary files.