# Combining JS Files When Previewing

**URL:** <https://forum.bootstrapstudio.io/t/combining-js-files-when-previewing/11386>\
**Category:** Ideas\
**Created:** [June 4, 2024, 8:00pm UTC](https://forum.bootstrapstudio.io/t/combining-js-files-when-previewing/11386 "2024-06-04T20:00:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueMarble](https://forum.bootstrapstudio.io/letter_avatar_proxy/v4/letter/b/d9b06d/32.png) [@BlueMarble](https://forum.bootstrapstudio.io/u/BlueMarble)\
**Post date:** [June 4, 2024, 8:00pm UTC](https://forum.bootstrapstudio.io/t/combining-js-files-when-previewing/11386/1 "2024-06-04T20:00:03Z")

</div>

When I preview certain designs, I sometimes get a ‘Uncaught ReferenceError’ JavaScript error.

In these cases, I have multiple JS files that are loaded in alphabetical order. A function that an earlier script needs is defined in a file that’s loaded later.

When exporting a design, it’s not an issue because all the JS files are combined into a single file. Would it be possible to do the same thing when previewing?

---

<div class="post-metadata">

**Author:** ![richards](https://forum.bootstrapstudio.io/user_avatar/forum.bootstrapstudio.io/richards/32/3163_2.png) [@richards](https://forum.bootstrapstudio.io/u/richards)\
**Post date:** [June 5, 2024, 7:49am UTC](https://forum.bootstrapstudio.io/t/combining-js-files-when-previewing/11386/2 "2024-06-05T07:49:57Z")

</div>

You can change the order that the js loads using the JS File Order.

![image](https://forum.bootstrapstudio.io/uploads/default/original/2X/0/040c49fb412a79433123184eaad819478305fd88.png)

Just right click on the Javascript dropdown in the design tab and click include order

> **[JavaScript Editing | Bootstrap Studio](https://bootstrapstudio.io/docs/js.html#js-file-order)**
>
> Tutorials and Guides about Bootstrap Studio, the revolutionary web design tool.

---

<div class="post-metadata">

**Author:** ![BlueMarble](https://forum.bootstrapstudio.io/letter_avatar_proxy/v4/letter/b/d9b06d/32.png) [@BlueMarble](https://forum.bootstrapstudio.io/u/BlueMarble)\
**Post date:** [June 8, 2024, 6:28pm UTC](https://forum.bootstrapstudio.io/t/combining-js-files-when-previewing/11386/3 "2024-06-08T18:28:55Z")

</div>

Thanks for this tip. I didn’t know it existed.
