# Minified javascript in a plugin causes optimizer to take a long time

**URL:** <https://discuss.elastic.co/t/minified-javascript-in-a-plugin-causes-optimizer-to-take-a-long-time/122681>\
**Category:** Kibana\
**Created:** [March 6, 2018, 9:29am UTC](https://discuss.elastic.co/t/minified-javascript-in-a-plugin-causes-optimizer-to-take-a-long-time/122681 "2018-03-06T09:29:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robrotheram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robrotheram/32/27262_2.png) [@robrotheram](https://discuss.elastic.co/u/robrotheram)\
**Post date:** [March 6, 2018, 9:29am UTC](https://discuss.elastic.co/t/minified-javascript-in-a-plugin-causes-optimizer-to-take-a-long-time/122681/1 "2018-03-06T09:29:09Z")

</div>

Hi there  
I creating a plugin for kibana 6 , That requires the use of a minified JavaScript library that is proprietary, the file is sadly approximately 2.5Mb. This causes webpack to take a ages \>40+ mins to optimize and cache the bundles. In the plugin I am doing `require('proprietary -lib.min.js')`

I looking on the web I added the library path to this.env.noParse in base\_optimizer.js but it is not improving the optimizer time. If anyone has any ideas that be great. Sadly I can not change the library code.

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [March 7, 2018, 10:37pm UTC](https://discuss.elastic.co/t/minified-javascript-in-a-plugin-causes-optimizer-to-take-a-long-time/122681/2 "2018-03-07T22:37:40Z")

</div>

Is this for a deployment or in development mode? In either case I'd recommend atleast 4GB of ram for the machine installing the plugin.

For production you can optimize on a beefier machine and then zip the whole package up for sending to a more resource constrained server.

For development I'd have to dig further if hardware isn't the cause. Bumping max old space size is worth a try (`NODE_OPTIONS=--max_old_space_size=4096`).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 4, 2018, 10:37pm UTC](https://discuss.elastic.co/t/minified-javascript-in-a-plugin-causes-optimizer-to-take-a-long-time/122681/3 "2018-04-04T22:37:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
