X-pack plugin install optimize bundles

Which files are you editing? kibana.bundle.js is generated by the optimize process, so any plugin installs and certain kibana.yml changes will clear it out. You'll want to make your changes in the corresponding files in the src folder, and when kibana.bundle.js is regenerated it will include the changes.