# Is it possible to include graphics in the custom module?

**URL:** <https://forum.inductiveautomation.com/t/is-it-possible-to-include-graphics-in-the-custom-module/95991>\
**Category:** Module Development\
**Tags:** perspective\
**Created:** [September 14, 2024, 5:33pm UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-include-graphics-in-the-custom-module/95991 "2024-09-14T17:33:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PRASHANTH\_KAKKIRALA](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@PRASHANTH\_KAKKIRALA](https://forum.inductiveautomation.com/u/PRASHANTH_KAKKIRALA)\
**Post date:** [September 14, 2024, 5:33pm UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-include-graphics-in-the-custom-module/95991/1 "2024-09-14T17:33:24Z")

</div>

I've built a custom module in java and created associated perspective graphics using designer.  
Is there a way I can include my graphic files in the custom module? so that they get added to designer and runtime whenever I import my custom module into gateway.

I wanted to avoid building another module for perspective components where I need to write the typescript/JavaScript code for graphics which will make no use of designer.

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [September 14, 2024, 6:11pm UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-include-graphics-in-the-custom-module/95991/2 "2024-09-14T18:11:25Z")

</div>

Absolutely, you _should_ be bundling your JavaScript and CSS with your module.

Check the SDK example out:

> **[ignition-sdk-examples/perspective-component-minimal at master ·...](https://github.com/inductiveautomation/ignition-sdk-examples/tree/master/perspective-component-minimal)**
>
> Ignition SDK Example Projects. Contribute to inductiveautomation/ignition-sdk-examples development by creating an account on GitHub.

Basic steps:

1. In your gateway hook register a resource folder by overriding `getMountedResourceFolder()`.
2. Create a set of `BrowserResources` for your components (see `common/OneComponent.java` in the example).
3. Register the `BrowserResources` to your component with `.setResources` (see `common/comp/Image.java` in the example).

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [September 14, 2024, 6:19pm UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-include-graphics-in-the-custom-module/95991/3 "2024-09-14T18:19:31Z")

</div>

> [@PRASHANTH\_KAKKIRALA](#):
>
> Is there a way I can include my graphic files in the custom module?

Exactly how you do this at build time is up to you. I’m not a fan of how the SDK examples do this, it’s over complicated and just kinda wrong (webpack is 🤮 and the way the gradle tasks are configured is not a good practice).

My recommendation is to build a WebJar with your web resources, then have your gateway scope depend on the WebJar with `modlImpl`.

See my Embr project for an example:

> <https://github.com/mussonindustrial/embr/blob/ae18b61b84fadfb13f26c062413a02857c33cceb/buildSrc/src/main/kotlin/embr.js-library-conventions.gradle.kts>
