# How To Add a Hack New Plugins

**URL:** <https://discuss.elastic.co/t/how-to-add-a-hack-new-plugins/237965>\
**Category:** Kibana\
**Created:** [June 21, 2020, 2:33pm UTC](https://discuss.elastic.co/t/how-to-add-a-hack-new-plugins/237965 "2020-06-21T14:33:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [June 21, 2020, 2:33pm UTC](https://discuss.elastic.co/t/how-to-add-a-hack-new-plugins/237965/1 "2020-06-21T14:33:21Z")

</div>

There is plenty of documentation on how to add a hack in kibana.plugin using UI exports.

How do you add them with the new plugin structure? I generated the plugin and using 7.7.2.

I assume it goes somewhere in here.

```auto
import { i18n } from '@kbn/i18n';
import { AppMountParameters, CoreSetup, CoreStart, Plugin } from '../../../src/core/public';
import {
  CustomCssServerPluginSetup,
  CustomCssServerPluginStart,
  AppPluginStartDependencies,
} from './types';
import { PLUGIN_NAME } from '../common';

export class CustomCssServerPlugin
  implements Plugin<CustomCssServerPluginSetup, CustomCssServerPluginStart> {
  public setup(core: CoreSetup): CustomCssServerPluginSetup {
    core.application.register({
      id: 'customCssServer',
      title: PLUGIN_NAME,
      async mount(params: AppMountParameters) {
        const { renderApp } = await import('./application');
        const [coreStart, depsStart] = await core.getStartServices();
        return renderApp(coreStart, depsStart as AppPluginStartDependencies, params);
      },
    });

    return {
      getGreeting() {
        return i18n.translate('customCssServer.greetingText', {
          defaultMessage: 'Hello from {name}!',
          values: {
            name: PLUGIN_NAME,
          },
        });
      },
    };
  }

  public start(core: CoreStart): CustomCssServerPluginStart {
    return {};
  }

  public stop() {}
}

```

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [June 21, 2020, 2:37pm UTC](https://discuss.elastic.co/t/how-to-add-a-hack-new-plugins/237965/2 "2020-06-21T14:37:17Z")

</div>

Is just importing a JS in plugin.ts the right answer?

```auto
import './hacks'

```

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [June 25, 2020, 1:48am UTC](https://discuss.elastic.co/t/how-to-add-a-hack-new-plugins/237965/3 "2020-06-25T01:48:55Z")

</div>

> [@aaron-nimocks](#):
>
> How do you add them with the new plugin structure?

Hacks are not supported in the Kibana platform.

---

<div class="post-metadata">

**Author:** ![seraphjiang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seraphjiang/32/47402_2.png) [@seraphjiang](https://discuss.elastic.co/u/seraphjiang)\
**Post date:** [July 13, 2020, 4:10pm UTC](https://discuss.elastic.co/t/how-to-add-a-hack-new-plugins/237965/4 "2020-07-13T16:10:08Z")

</div>

does this mean, hacks were supported in legacy platform, but are not supported in new Kibana platform

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [July 13, 2020, 4:22pm UTC](https://discuss.elastic.co/t/how-to-add-a-hack-new-plugins/237965/5 "2020-07-13T16:22:26Z")

</div>

Sounds like they wont "support" them. But if you just add a JS file in plugin.ts you can still do it.

```auto
import './hacks'

```

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [July 25, 2020, 10:07pm UTC](https://discuss.elastic.co/t/how-to-add-a-hack-new-plugins/237965/6 "2020-07-25T22:07:39Z")

</div>

What would you like to make happen?

Hacks introduced global effects which can be very difficult to maintain and reason about which is why such behavior is not directly supported in the Kibana platform.

---

<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, 2020, 10:07pm UTC](https://discuss.elastic.co/t/how-to-add-a-hack-new-plugins/237965/7 "2020-08-22T22:07:44Z")

</div>

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