diff --git a/.gitignore b/.gitignore index e850c508..8d473c98 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ !jest.config.js !jest.setup.js !.eslintrc.js -*.d.ts node_modules dist @@ -13,3 +12,5 @@ dist cdk.out *.tsbuildinfo + +vite.config.d.ts \ No newline at end of file diff --git a/newswires/client/src/global.d.ts b/newswires/client/src/global.d.ts new file mode 100644 index 00000000..660ecc1c --- /dev/null +++ b/newswires/client/src/global.d.ts @@ -0,0 +1,8 @@ +/** + * @see: + * - https://github.com/elastic/eui/issues/5463#issuecomment-1107665339 + * - https://github.com/elastic/eui/tree/main/wiki/consuming-eui + * - https://stackoverflow.com/questions/76202223/vite-elastic-ui-failing-to-dynamically-import-icons-for-euiicon/77313511#77313511 + */ +declare module '@elastic/eui/es/components/icon/*'; +declare module '@elastic/eui/es/components/icon/icon'; diff --git a/newswires/client/src/icons.ts b/newswires/client/src/icons.ts index 5f8ed160..d2a3f9f5 100644 --- a/newswires/client/src/icons.ts +++ b/newswires/client/src/icons.ts @@ -19,6 +19,15 @@ import { icon as search } from '@elastic/eui/es/components/icon/assets/search'; import { icon as warning } from '@elastic/eui/es/components/icon/assets/warning'; import { appendIconComponentCache } from '@elastic/eui/es/components/icon/icon'; +/** + * @see: + * - https://github.com/elastic/eui/issues/5463#issuecomment-1107665339 + * - https://github.com/elastic/eui/tree/main/wiki/consuming-eui + * - https://stackoverflow.com/questions/76202223/vite-elastic-ui-failing-to-dynamically-import-icons-for-euiicon/77313511#77313511 + */ +declare module '@elastic/eui/es/components/icon/*'; +declare module '@elastic/eui/es/components/icon/icon'; + // One or more icons are passed in as an object of iconKey (string): IconComponent appendIconComponentCache({ clock,