I need to add some custom code to one of the JS files present in the Kibana release zip: https://www.elastic.co/downloads/kibana
Right now, when I run the Kibana I see the following JS files which are minified and bundled:
and it comes from the Kibana's optimize folder:
Is there any way to run the non modified version present at /src location:
My goal is to add a custom querystring param to each search request done via Kibana:
http://localhost:5601/elasticsearch/_msearch
therefore, trying to figure out the exact file which make this request but right now with minified file it seems hard to find that location.
If we have to make some change in any of the existing JS file, the optimize folder has to be deleted so that on next restart of Kibana service the file bundling can take place to acomodate our custom change. This takes enough time which makes the debugging with JS files of Kibana very time consuming.
How to prevent this bundling step so that the JS debugging can become easy with Kibana.
I believe that the best approach for what you want to achieve is to clone Kibana GitHub repository since trying to work with a minified version of the scripts that Kibana utilizes are nearly impossible, the purpose of minified JS is not to editable but lightweight. Keep in mind that you are going to need to install all the necessary dependencies. All of it is explained on the CONTRIBUTING.md the file available in the official repository.
I could get it up and running with the following commands, but I'm a Linux user, you are going to need to use the equivalent on windows.
# Prepare your environment
# Install node 10.15.2 as specified in the file .node-version
# Install OpenJDK-8
apt-get update && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant && \
apt-get clean;
# Setup JAVA_HOME
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
export JAVA_HOME
# Install dependencies and run
git clone https://github.com/[YOUR_USERNAME]/kibana.git kibana
cd kibana
npm i yarn -g
yarn kbn bootstrap
yarn start
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With