audit file urls (#2853)

This commit is contained in:
Fred K. Schott 2022-03-22 14:49:27 -07:00 committed by GitHub
parent 1cab405460
commit 8ec3d0da19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -7,7 +7,7 @@ import type { ViteConfigWithSSR } from '../create-vite.js';
import { fileURLToPath } from 'url'; import { fileURLToPath } from 'url';
import * as vite from 'vite'; import * as vite from 'vite';
import { createBuildInternals } from '../../core/build/internal.js'; import { createBuildInternals } from '../../core/build/internal.js';
import { rollupPluginAstroBuildHTML } from '../../vite-plugin-build-html/index.js'; import { rollupPluginAstroScanHTML } from '../../vite-plugin-build-html/index.js';
import { rollupPluginAstroBuildCSS } from '../../vite-plugin-build-css/index.js'; import { rollupPluginAstroBuildCSS } from '../../vite-plugin-build-css/index.js';
import { RouteCache } from '../render/route-cache.js'; import { RouteCache } from '../render/route-cache.js';
@ -63,7 +63,7 @@ export async function build(opts: ScanBasedBuildOptions) {
target: 'es2020', // must match an esbuild target target: 'es2020', // must match an esbuild target
}, },
plugins: [ plugins: [
rollupPluginAstroBuildHTML({ rollupPluginAstroScanHTML({
astroConfig, astroConfig,
internals, internals,
logging, logging,

View file

@ -273,7 +273,7 @@ export async function loadConfig(configOptions: LoadConfigOptions): Promise<Astr
if (flags?.config) { if (flags?.config) {
userConfigPath = /^\.*\//.test(flags.config) ? flags.config : `./${flags.config}`; userConfigPath = /^\.*\//.test(flags.config) ? flags.config : `./${flags.config}`;
userConfigPath = fileURLToPath(new URL(userConfigPath, `file://${root}/`)); userConfigPath = fileURLToPath(new URL(userConfigPath, pathToFileURL(root)));
} }
// Automatically load config file using Proload // Automatically load config file using Proload
// If `userConfigPath` is `undefined`, Proload will search for `astro.config.[cm]?[jt]s` // If `userConfigPath` is `undefined`, Proload will search for `astro.config.[cm]?[jt]s`

View file

@ -43,7 +43,7 @@ function relativePath(from: string, to: string): string {
return prependDotSlash(rel); return prependDotSlash(rel);
} }
export function rollupPluginAstroBuildHTML(options: PluginOptions): VitePlugin { export function rollupPluginAstroScanHTML(options: PluginOptions): VitePlugin {
const { astroConfig, internals, logging, origin, allPages, routeCache, viteServer, pageNames } = options; const { astroConfig, internals, logging, origin, allPages, routeCache, viteServer, pageNames } = options;
// The filepath root of the src folder // The filepath root of the src folder