[ci] format
This commit is contained in:
parent
f8f4d49aba
commit
cb5dbcc51f
3 changed files with 8 additions and 7 deletions
|
@ -2,7 +2,6 @@ import * as eslexer from 'es-module-lexer';
|
||||||
import glob from 'fast-glob';
|
import glob from 'fast-glob';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { bgGreen, bgMagenta, black, dim } from 'kleur/colors';
|
import { bgGreen, bgMagenta, black, dim } from 'kleur/colors';
|
||||||
import path from 'path';
|
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import * as vite from 'vite';
|
import * as vite from 'vite';
|
||||||
import { astroBundleDelayedAssetPlugin } from '../../content/index.js';
|
import { astroBundleDelayedAssetPlugin } from '../../content/index.js';
|
||||||
|
@ -10,9 +9,8 @@ import {
|
||||||
BuildInternals,
|
BuildInternals,
|
||||||
createBuildInternals,
|
createBuildInternals,
|
||||||
eachPrerenderedPageData,
|
eachPrerenderedPageData,
|
||||||
isHoistedScript,
|
|
||||||
} from '../../core/build/internal.js';
|
} from '../../core/build/internal.js';
|
||||||
import { emptyDir, removeDir, removeEmptyDirs } from '../../core/fs/index.js';
|
import { emptyDir, removeEmptyDirs } from '../../core/fs/index.js';
|
||||||
import { appendForwardSlash, prependForwardSlash } from '../../core/path.js';
|
import { appendForwardSlash, prependForwardSlash } from '../../core/path.js';
|
||||||
import { isModeServerWithNoAdapter } from '../../core/util.js';
|
import { isModeServerWithNoAdapter } from '../../core/util.js';
|
||||||
import { runHookBuildSetup } from '../../integrations/index.js';
|
import { runHookBuildSetup } from '../../integrations/index.js';
|
||||||
|
|
|
@ -15,12 +15,12 @@ export function removeEmptyDirs(root: URL): void {
|
||||||
const dir = fileURLToPath(root);
|
const dir = fileURLToPath(root);
|
||||||
if (!fs.statSync(dir).isDirectory()) return;
|
if (!fs.statSync(dir).isDirectory()) return;
|
||||||
let files = fs.readdirSync(dir);
|
let files = fs.readdirSync(dir);
|
||||||
|
|
||||||
if (files.length > 0) {
|
if (files.length > 0) {
|
||||||
files.map(file => {
|
files.map((file) => {
|
||||||
const url = new URL(`./${file}`, appendForwardSlash(root.toString()));
|
const url = new URL(`./${file}`, appendForwardSlash(root.toString()));
|
||||||
removeEmptyDirs(url);
|
removeEmptyDirs(url);
|
||||||
})
|
});
|
||||||
files = fs.readdirSync(dir);
|
files = fs.readdirSync(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,10 @@ export async function ssgBuild({
|
||||||
let outputFileURL: URL;
|
let outputFileURL: URL;
|
||||||
|
|
||||||
if (isRemoteImage(src)) {
|
if (isRemoteImage(src)) {
|
||||||
outputFileURL = new URL(path.join(`./${config.build.assets}`, path.basename(filename)), outDir);
|
outputFileURL = new URL(
|
||||||
|
path.join(`./${config.build.assets}`, path.basename(filename)),
|
||||||
|
outDir
|
||||||
|
);
|
||||||
outputFile = fileURLToPath(outputFileURL);
|
outputFile = fileURLToPath(outputFileURL);
|
||||||
} else {
|
} else {
|
||||||
outputFileURL = new URL(path.join(`./${config.build.assets}`, filename), outDir);
|
outputFileURL = new URL(path.join(`./${config.build.assets}`, filename), outDir);
|
||||||
|
|
Loading…
Add table
Reference in a new issue