|
1 | 1 | import { extname } from 'node:path'; |
2 | 2 | import { pathToFileURL } from 'node:url'; |
3 | | -import type { Plugin, Rollup } from 'vite'; |
| 3 | +import type { Plugin } from 'vite'; |
4 | 4 | import type { AstroSettings, SSRElement } from '../@types/astro.js'; |
5 | 5 | import { getAssetsPrefix } from '../assets/utils/getAssetsPrefix.js'; |
6 | 6 | import type { BuildInternals } from '../core/build/internal.js'; |
@@ -129,22 +129,9 @@ export function astroConfigBuildPlugin( |
129 | 129 | options: StaticBuildOptions, |
130 | 130 | internals: BuildInternals |
131 | 131 | ): AstroBuildPlugin { |
132 | | - let ssrPluginContext: Rollup.PluginContext | undefined = undefined; |
133 | 132 | return { |
134 | 133 | targets: ['server'], |
135 | 134 | hooks: { |
136 | | - 'build:before': ({ target }) => { |
137 | | - return { |
138 | | - vitePlugin: { |
139 | | - name: 'astro:content-build-plugin', |
140 | | - generateBundle() { |
141 | | - if (target === 'server') { |
142 | | - ssrPluginContext = this; |
143 | | - } |
144 | | - }, |
145 | | - }, |
146 | | - }; |
147 | | - }, |
148 | 135 | 'build:post': ({ ssrOutputs, clientOutputs, mutate }) => { |
149 | 136 | const outputs = ssrOutputs.flatMap((o) => o.output); |
150 | 137 | const prependBase = (src: string) => { |
@@ -232,8 +219,6 @@ export function astroConfigBuildPlugin( |
232 | 219 | mutate(chunk, ['server'], newCode); |
233 | 220 | } |
234 | 221 | } |
235 | | - |
236 | | - ssrPluginContext = undefined; |
237 | 222 | }, |
238 | 223 | }, |
239 | 224 | }; |
|
0 commit comments