# \[SOLVED\] Compile Uppy JS with the necessary plugins only

**URL:** https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831
**Category:** Uppy
**Created:** [March 7, 2019, 2:13pm UTC](https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831 "2019-03-07T14:13:45Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![psr](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@psr](https://community.transloadit.com/u/psr)
#### Post date: [March 7, 2019, 2:13pm UTC](https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831/1 "2019-03-07T14:13:45Z")

</div>

Hello community,

I have a question because I do not know how to proceed 🙃

I would like to implement Uppy but I do not know how to compile only the elements/plugins I need :

 ![ghokpoojlgfilmba](https://canada1.discourse-cdn.com/flex032/uploads/transloadit/original/1X/03c5b9adf3ced0c94fd99aee2ceb2f259e062053.png)

Do you know how I can compile a uppy.js with the plugins I only need please ? (it could also be used by other Uppy users)

I work with gulp for concat, minify/uglify.

Thanks for your help !

---

<div class="post-metadata">

### Author: ![psr](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@psr](https://community.transloadit.com/u/psr)
#### Post date: [March 8, 2019, 3:50pm UTC](https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831/2 "2019-03-08T15:50:40Z")

</div>

Hello there,

Someone to help me please?

Thank you 🙂

---

<div class="post-metadata">

### Author: ![kvz](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/kvz/32/606_2.png) [@kvz](https://community.transloadit.com/u/kvz)
#### Post date: [March 8, 2019, 3:53pm UTC](https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831/3 "2019-03-08T15:53:21Z")

</div>

Hey,not sure if that’s gonna work, but if you use Webpack or Browserify or Packer or Rollup it’s as easy as requiring the npm.

Does that help?

---

<div class="post-metadata">

### Author: ![psr](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@psr](https://community.transloadit.com/u/psr)
#### Post date: [March 8, 2019, 4:05pm UTC](https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831/4 "2019-03-08T16:05:25Z")

</div>

Hey Kevin,

Thank you for your reply.

I’m more comfortable with Gulp, do you know if it’s possible?

---

<div class="post-metadata">

### Author: ![kvz](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/kvz/32/606_2.png) [@kvz](https://community.transloadit.com/u/kvz)
#### Post date: [March 11, 2019, 8:48am UTC](https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831/5 "2019-03-11T08:48:18Z")

</div>

I think since Gulp with Concat basically just copies all the files and pastes them into one big new file, there will be collisions of variables, and also the files themselves will want to do `require`s which just do not work natively in the browser. The `require`s need to be rewritten, which is what those other bundlers work well for. Admittedly I’m a bit out of my comfort zone in this domain, but from my understanding, I don’t see how it could work with plain concatenation of sources, and I would recommend using a newer bundler for this, or if that’s hassle, just use Uppy from the CDN 🙂

---

<div class="post-metadata">

### Author: ![psr](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@psr](https://community.transloadit.com/u/psr)
#### Post date: [March 12, 2019, 3:07pm UTC](https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831/6 "2019-03-12T15:07:50Z")

</div>

Hi Kevin,

I may have misrepresented my need.

For example, I would not need the following plugin: @uppy/instagram.  
I wish I could use a lighter JS file with my needs only.

Thank you !

---

<div class="post-metadata">

### Author: ![goto-bus-stop](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/goto-bus-stop/32/18_2.png) [@goto-bus-stop](https://community.transloadit.com/u/goto-bus-stop)
#### Post date: [March 13, 2019, 11:42am UTC](https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831/7 "2019-03-13T11:42:40Z")

</div>

You need to create a custom bundle to only include the plugins you need. If you’re not using a bundler for the rest of your application, you can create one just for Uppy.

- Install browserify

```auto
npm install -g browserify

```

- Install the Uppy modules that you will use

```auto
npm install @uppy/core @uppy/tus @uppy/dashboard

```

- Create a file that only includes the plugins you need

```auto
// custom-uppy.js
window.Uppy = {}
Uppy.Core = require('@uppy/core')
Uppy.Tus = require('@uppy/tus')
Uppy.Dashboard = require('@uppy/dashboard')

```

- Create a bundle using browserify

```auto
browserify custom-uppy.js -o my-uppy-bundle.js

```

Now, you can use `my-uppy-bundle.js` in a script tag or use gulp-concat to add it to the start of your scripts. It will define a global `Uppy` variable just like the build that comes with the `uppy` package, but with only the things you need.

You can just copy the `my-uppy-bundle.js` file into your project, so you don’t need to use browserify or another bundler for your other files.

I don’t think we’ll provide more minimal bundles ourselves, because there are so many possible combinations. We’d have to build 100+ bundles to serve every use case probably 😅

Hope that helps!

---

<div class="post-metadata">

### Author: ![psr](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@psr](https://community.transloadit.com/u/psr)
#### Post date: [March 13, 2019, 4:22pm UTC](https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831/8 "2019-03-13T16:22:27Z")

</div>

Hey @goto-bus-stop

Thank you for your help !

I think I need :

- @uppy/core
- @uppy/aws-s3-multipart

To use @uppy/aws-s3-multipart, are there other plugins to consider ? 😋

---

<div class="post-metadata">

### Author: ![psr](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@psr](https://community.transloadit.com/u/psr)
#### Post date: [March 15, 2019, 1:49pm UTC](https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831/9 "2019-03-15T13:49:29Z")

</div>

Hi

I managed to do what I wanted, it works like a charm!

Thank you all for your help.

---

<div class="post-metadata">

### Author: ![kvz](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/kvz/32/606_2.png) [@kvz](https://community.transloadit.com/u/kvz)
#### Post date: [March 21, 2019, 10:45am UTC](https://community.transloadit.com/t/solved-compile-uppy-js-with-the-necessary-plugins-only/14831/10 "2019-03-21T10:45:58Z")

</div>

Glad you were able to figure it out! And thanks for the great help here @goto-bus-stop 👍
