How to prevent settings.yml from being packaged into the app?

답변함

5 댓글

  • Tipene Hughes
    Zendesk Developer Advocacy

    Hey RC,

    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!

    Tipene

    0
  • Eric Snell

    Tipene Hughes

    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?

    0
  • Tipene Hughes
    Zendesk Developer Advocacy

    Hey Eric,

    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:
    https://github.com/zendesk/sell-zaf-app-scaffold

    I hope this helps! Let me know if you have any questions.

    Tipene

    0
  • Eric Snell

    Thanks Tipene Hughes!

    Is this possible with ZAT as well? I don't see it listed anywhere in the docs.

    0
  • Tipene Hughes
    Zendesk Developer Advocacy
    Sure is! You'd just use the --path flag on your package command e.g zat package --path=./dist
    0

댓글을 남기려면 로그인하세요.

Zendesk 제공