Remove extra stuff
This commit is contained in:
parent
56a952fae0
commit
4194e8b8f8
2 changed files with 6 additions and 6 deletions
|
@ -34,7 +34,6 @@ class AstroBuilder {
|
||||||
private logging: LogOptions;
|
private logging: LogOptions;
|
||||||
private mode = 'production';
|
private mode = 'production';
|
||||||
private origin: string;
|
private origin: string;
|
||||||
private port: number;
|
|
||||||
private routeCache: RouteCache = {};
|
private routeCache: RouteCache = {};
|
||||||
private manifest: ManifestData;
|
private manifest: ManifestData;
|
||||||
private viteServer?: ViteDevServer;
|
private viteServer?: ViteDevServer;
|
||||||
|
@ -47,9 +46,9 @@ class AstroBuilder {
|
||||||
|
|
||||||
if (options.mode) this.mode = options.mode;
|
if (options.mode) this.mode = options.mode;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.port = config.devOptions.port;
|
const port = config.devOptions.port; // no need to save this (don’t rely on port in builder)
|
||||||
this.logging = options.logging;
|
this.logging = options.logging;
|
||||||
this.origin = config.buildOptions.site ? new URL(config.buildOptions.site).origin : `http://localhost:${this.port}`;
|
this.origin = config.buildOptions.site ? new URL(config.buildOptions.site).origin : `http://localhost:${port}`;
|
||||||
this.manifest = createRouteManifest({ config }, this.logging);
|
this.manifest = createRouteManifest({ config }, this.logging);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +62,8 @@ class AstroBuilder {
|
||||||
{
|
{
|
||||||
mode: this.mode,
|
mode: this.mode,
|
||||||
server: {
|
server: {
|
||||||
hmr: { overlay: false }
|
hmr: { overlay: false },
|
||||||
|
middlewareMode: 'ssr',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
this.config.vite || {}
|
this.config.vite || {}
|
||||||
|
@ -72,8 +72,6 @@ class AstroBuilder {
|
||||||
);
|
);
|
||||||
this.viteConfig = viteConfig;
|
this.viteConfig = viteConfig;
|
||||||
const viteServer = await vite.createServer(viteConfig);
|
const viteServer = await vite.createServer(viteConfig);
|
||||||
// Listen to the server so that we can make fetch requests if needed.
|
|
||||||
await viteServer.listen(this.port);
|
|
||||||
this.viteServer = viteServer;
|
this.viteServer = viteServer;
|
||||||
debug(logging, 'build', timerMessage('Vite started', timer.viteStart));
|
debug(logging, 'build', timerMessage('Vite started', timer.viteStart));
|
||||||
|
|
||||||
|
|
|
@ -465,6 +465,8 @@ export function rollupPluginAstroBuildHTML(options: PluginOptions): VitePlugin[]
|
||||||
},
|
},
|
||||||
async load(id) {
|
async load(id) {
|
||||||
try {
|
try {
|
||||||
|
// This uses ssrLoadModule and not transformResult because
|
||||||
|
// transformResult is always giving JavaScript.
|
||||||
const mod = await viteServer.ssrLoadModule(id);
|
const mod = await viteServer.ssrLoadModule(id);
|
||||||
return mod.default;
|
return mod.default;
|
||||||
} catch {
|
} catch {
|
||||||
|
|
Loading…
Reference in a new issue