Skip to content

Commit

Permalink
update injectelement todo
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Mar 18, 2022
1 parent 7c2edbb commit a4d5bab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 4 additions & 1 deletion packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,10 @@ export interface AstroIntegration {
updateConfig: (newConfig: Record<string, any>) => void;
addRenderer: (renderer: AstroRenderer) => void;
injectScript: (stage: InjectedScriptStage, content: string) => void;
injectElement: (stage: vite.HtmlTagDescriptor, element: string) => void;
// TODO: Add support for `injectElement()` for full HTML element injection, not just scripts.
// This may require some refactoring of `scripts`, `styles`, and `links` into something
// more generalized. Consider the SSR use-case as well.
// injectElement: (stage: vite.HtmlTagDescriptor, element: string) => void;
}) => void;
'astro:config:done'?: (options: { config: AstroConfig }) => void | Promise<void>;
'astro:server:setup'?: (options: { server: vite.ViteDevServer }) => void | Promise<void>;
Expand Down
6 changes: 0 additions & 6 deletions packages/astro/src/integrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ export async function runHookConfigSetup({ config: _config, command }: { config:
addRenderer(renderer: AstroRenderer) {
updatedConfig._ctx.renderers.push(renderer);
},
// TODO: Add support for `injectElement()` for full HTML element injection, not just scripts.
// This may require some refactoring of `scripts`, `styles`, and `links` into something
// more generalized. Consider the SSR use-case as well.
injectElement: () => {
throw new Error('TODO: Implement');
},
injectScript: (stage, content) => {
updatedConfig._ctx.scripts.push({ stage, content });
},
Expand Down

0 comments on commit a4d5bab

Please sign in to comment.