How to prevent settings.yml from being packaged into the app?Respondida
I've got an app that works great. In the app is a manifest.json file specifying that a token field is required via parameters. For local dev work I have a settings.yml file in my root directory:
One of my colleagues downloaded the .zip of this app and peeked inside and noticed the settings.yml file was there. Since this file contains a secret token I would really prefer it not get packaged up when running `zat package`.
Is there any sort of ".zatignore" where I can tell zat to not include that file in the app package? I couldn't find anything in the KB around preventing the settings file from being packaged up.
Sorry for the delay in getting back to you!
I think the best way to approach this would be to make your settings.yml a hidden file (“.settings.yml”). This will ensure that the file is skipped over when the app is packaged using zat package.
I hope this helps. Feel free to reach out if you have any questions!
Related: How could we prevent node_modules from being included in the package? I have a react app and have had to create a temporary workaround using pre and post package scripts that essentially remove and reinstall (respectively) all dependencies. Is there a better solution?
ZCLI and ZAT will attempt to package any files contained within the directory you specify, or the root directory if none is specified. So, before using ZCLI or ZAT to package your app, you’ll need to make sure that your bundler (e.g. webpack) is not adding the node_modules folder to the build/dist directory that’s created at build time. Then, you can specify the directory to run the packaging process, i.e zcli:apps create ./dist.
Here’s an example Zendesk react app to take a look at that you might find helpful:
I hope this helps! Let me know if you have any questions.
Thanks Tipene Hughes!
Is this possible with ZAT as well? I don't see it listed anywhere in the docs.
Sure is! You'd just use the
--pathflag on your package command e.g
zat package --path=./dist
Por favor, entrar para comentar.