# Config files in custom plugin

**URL:** <https://discuss.elastic.co/t/config-files-in-custom-plugin/189232>\
**Category:** Kibana\
**Created:** [July 7, 2019, 4:38am UTC](https://discuss.elastic.co/t/config-files-in-custom-plugin/189232 "2019-07-07T04:38:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adityaPsl](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@adityaPsl](https://discuss.elastic.co/u/adityaPsl)\
**Post date:** [July 7, 2019, 4:38am UTC](https://discuss.elastic.co/t/config-files-in-custom-plugin/189232/1 "2019-07-07T04:38:54Z")

</div>

Hello Team,  
I am working on custom Kibana plugin.  
Could you please help me understand how can I keep common settings in configuration file so that I don't have to rebuild the code.  
I tried creating conf.js (at root level in \<plugin\_name\> folder )file and import it using require('conf.js') in router js but I am getting cannot find module error.

Kibana version : 6.7

Thank you for your help and support.  
Thank you,  
Aditya Deshpande

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [July 8, 2019, 4:04pm UTC](https://discuss.elastic.co/t/config-files-in-custom-plugin/189232/2 "2019-07-08T16:04:55Z")

</div>

Hi there Aditya!

You'll need to use a relative import to get access to that file:

```auto
import conf from './conf';
// or
const conf = require('./conf');

```

---

<div class="post-metadata">

**Author:** ![adityaPsl](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@adityaPsl](https://discuss.elastic.co/u/adityaPsl)\
**Post date:** [July 25, 2019, 4:24pm UTC](https://discuss.elastic.co/t/config-files-in-custom-plugin/189232/3 "2019-07-25T16:24:18Z")

</div>

Hi joshdover,  
Sorry for the delayed response.  
I tried to add config.js with const values, I was getting module not found error. When looked at the zip file in build folder I realised the file is not available in the zip folder.  
Could you please help me understand how yarn build creates zip and copies file.

Thank you for your help and support.

Thank you,  
Aditya

---

<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:** [August 22, 2019, 4:24pm UTC](https://discuss.elastic.co/t/config-files-in-custom-plugin/189232/4 "2019-08-22T16:24:25Z")

</div>

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