# Building InDesign UXP Plugins without index.html?

**URL:** <https://forums.creativeclouddeveloper.com/t/building-indesign-uxp-plugins-without-index-html/7404>\
**Category:** InDesign\
**Tags:** uxp\
**Created:** [January 22, 2024, 2:58pm UTC](https://forums.creativeclouddeveloper.com/t/building-indesign-uxp-plugins-without-index-html/7404 "2024-01-22T14:58:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David1](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@David1](https://forums.creativeclouddeveloper.com/u/David1)\
**Post date:** [January 22, 2024, 2:58pm UTC](https://forums.creativeclouddeveloper.com/t/building-indesign-uxp-plugins-without-index-html/7404/1 "2024-01-22T14:58:18Z")

</div>

I’m trying to build a UXP plugin with components (App.js & main.js) but keep getting errors. Is this approach better than using index.html. Is it worth the hassle, or should I stick with the HTML way? Looking for advice and maybe a basic example of using .js components.

---

<div class="post-metadata">

**Author:** ![medium\_jon](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/medium_jon/32/2371_2.png) [@medium\_jon](https://forums.creativeclouddeveloper.com/u/medium_jon)\
**Post date:** [January 22, 2024, 3:46pm UTC](https://forums.creativeclouddeveloper.com/t/building-indesign-uxp-plugins-without-index-html/7404/2 "2024-01-22T15:46:12Z")

</div>

David, if I’m understanding the question correctly, I believe you use `require` and specify an `.mjs` file like the following:

` const { IdPreferencesDataStructure } = require("./idPreferencesDataStructure.mjs");`  
`const { alert_displayDialogAsync } = require("../sharedModules/alert.mjs");`

This is listed _somewhere_ in Adobe’s documentation, but I don’t remember where.

WARNING: even though your development environment might be happy allowing you to load a module from outside the UXP project’s root folder, UXP itself won’t allow that.

jsw

---

<div class="post-metadata">

**Author:** ![David1](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@David1](https://forums.creativeclouddeveloper.com/u/David1)\
**Post date:** [January 22, 2024, 7:48pm UTC](https://forums.creativeclouddeveloper.com/t/building-indesign-uxp-plugins-without-index-html/7404/3 "2024-01-22T19:48:18Z")

</div>

I should try to clarify and say that I’m getting better but still pretty new at this. I’ve had success with the UXP templates with `index.html` for UI and separate JavaScript files for logic. This feels straightforward, but I’ve seen others building UXP plugins for photoshop with just an `App.js` file with linked components and scripts, skipping `index.html` then importing that into the main.js. They claim it’s more consistent, but when I try this, I encounter errors, like .app not available, can’t resolve module main.js.

Is it standard practice or necessary to use the index.html?

Are there any successful simple examples that would show a simple wired up ui using that method?

I’m unsure if pursuing this component-based approach without `index.html` is worth the hassle, or stick with the `index.html` workflow.
