From f4a9817b94c1cd162aef6cf5afe7e6564eda3651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 11 Oct 2018 08:49:12 +0200 Subject: [PATCH] poc: frontend extensions --- public/app/extensions/index.ts | 4 ++++ public/app/extensions/test/test.ts | 3 +++ public/app/routes/routes.ts | 1 + 3 files changed, 8 insertions(+) create mode 100644 public/app/extensions/index.ts create mode 100644 public/app/extensions/test/test.ts diff --git a/public/app/extensions/index.ts b/public/app/extensions/index.ts new file mode 100644 index 00000000000..d265303a6ee --- /dev/null +++ b/public/app/extensions/index.ts @@ -0,0 +1,4 @@ +let components = (require as any).context('.', true, /\.tsx?/); +components.keys().forEach(key => { + console.log('extension component', components(key)); +}); diff --git a/public/app/extensions/test/test.ts b/public/app/extensions/test/test.ts new file mode 100644 index 00000000000..be4fd52ed2d --- /dev/null +++ b/public/app/extensions/test/test.ts @@ -0,0 +1,3 @@ +export class Tester {} + +console.log('Tester'); diff --git a/public/app/routes/routes.ts b/public/app/routes/routes.ts index 9aecf53e7bb..aa783c37006 100644 --- a/public/app/routes/routes.ts +++ b/public/app/routes/routes.ts @@ -1,5 +1,6 @@ import './dashboard_loaders'; import './ReactContainer'; +import '../extensions'; import ServerStats from 'app/features/admin/ServerStats'; import AlertRuleList from 'app/features/alerting/AlertRuleList';