# Is there way to include other JavaScript source?

**URL:** <https://forums.creativeclouddeveloper.com/t/is-there-way-to-include-other-javascript-source/3408>\
**Category:** UXP Plugin API\
**Tags:** javascript\
**Created:** [July 27, 2021, 11:25pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-way-to-include-other-javascript-source/3408 "2021-07-27T23:25:01Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![kerrishotts](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kerrishotts/32/8_2.png) [@kerrishotts](https://forums.creativeclouddeveloper.com/u/kerrishotts)\
**Post date:** [August 10, 2021, 7:14pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-way-to-include-other-javascript-source/3408/8 "2021-08-10T19:14:32Z")

</div>

Note that if you’re _not_ using webpack, you’ll need to use relative paths. The `require` function _does not do node-style resolution_ or lookup.

As such:

- `require("module.js")` _will_ fail because it’s not relative. Using `require("./module.js")` will work, assuming it’s in the same directory.
- If you’ve got `node_modules/commonLib.js`, you’ll need to use `require("./node_modules/commonLib.js")` (assuming `main.js` is i

Be sure to also use `module.exports = {/*...*/}` when doing this (ES6-style exports are _not_ supported using this mechanism.)

If you want to use ES6 modules or have node-style resolution, a bundler is a requirement.

---

_[View the full topic](https://forums.creativeclouddeveloper.com/t/is-there-way-to-include-other-javascript-source/3408)._
