summaryrefslogtreecommitdiff
path: root/packages/astro/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro/src')
-rw-r--r--packages/astro/src/@types/astro.ts4
-rw-r--r--packages/astro/src/assets/services/vendor/squoosh/avif/avif_node_dec.ts6
-rw-r--r--packages/astro/src/assets/services/vendor/squoosh/avif/avif_node_enc.ts6
-rw-r--r--packages/astro/src/assets/services/vendor/squoosh/image-pool.ts4
-rw-r--r--packages/astro/src/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_dec.ts6
-rw-r--r--packages/astro/src/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_enc.ts6
-rw-r--r--packages/astro/src/assets/services/vendor/squoosh/webp/webp_node_dec.ts6
-rw-r--r--packages/astro/src/assets/services/vendor/squoosh/webp/webp_node_enc.ts6
-rw-r--r--packages/astro/src/assets/utils/transformToPath.ts2
-rw-r--r--packages/astro/src/assets/vendor/image-size/index.ts4
-rw-r--r--packages/astro/src/assets/vendor/image-size/types/tiff.ts2
-rw-r--r--packages/astro/src/cli/add/index.ts6
-rw-r--r--packages/astro/src/cli/check/index.ts4
-rw-r--r--packages/astro/src/cli/check/print.ts2
-rw-r--r--packages/astro/src/cli/dev/index.ts2
-rw-r--r--packages/astro/src/cli/load-settings.ts2
-rw-r--r--packages/astro/src/cli/sync/index.ts2
-rw-r--r--packages/astro/src/config/index.ts2
-rw-r--r--packages/astro/src/content/vite-plugin-content-imports.ts2
-rw-r--r--packages/astro/src/core/app/node.ts6
-rw-r--r--packages/astro/src/core/build/common.ts4
-rw-r--r--packages/astro/src/core/build/css-asset-name.ts4
-rw-r--r--packages/astro/src/core/build/generate.ts6
-rw-r--r--packages/astro/src/core/build/index.ts4
-rw-r--r--packages/astro/src/core/build/static-build.ts7
-rw-r--r--packages/astro/src/core/compile/compile.ts2
-rw-r--r--packages/astro/src/core/compile/style.ts2
-rw-r--r--packages/astro/src/core/config/config.ts6
-rw-r--r--packages/astro/src/core/config/schema.ts2
-rw-r--r--packages/astro/src/core/config/settings.ts2
-rw-r--r--packages/astro/src/core/config/timer.ts2
-rw-r--r--packages/astro/src/core/config/tsconfig.ts4
-rw-r--r--packages/astro/src/core/config/vite-load.ts4
-rw-r--r--packages/astro/src/core/create-vite.ts4
-rw-r--r--packages/astro/src/core/dev/container.ts6
-rw-r--r--packages/astro/src/core/dev/dev.ts4
-rw-r--r--packages/astro/src/core/errors/dev/vite.ts4
-rw-r--r--packages/astro/src/core/fs/index.ts8
-rw-r--r--packages/astro/src/core/logger/node.ts4
-rw-r--r--packages/astro/src/core/module-loader/loader.ts4
-rw-r--r--packages/astro/src/core/module-loader/vite.ts2
-rw-r--r--packages/astro/src/core/preview/index.ts2
-rw-r--r--packages/astro/src/core/preview/static-preview-server.ts4
-rw-r--r--packages/astro/src/core/preview/vite-plugin-astro-preview.ts4
-rw-r--r--packages/astro/src/core/render/dev/vite.ts2
-rw-r--r--packages/astro/src/core/request.ts2
-rw-r--r--packages/astro/src/core/routing/manifest/create.ts6
-rw-r--r--packages/astro/src/core/util.ts6
-rw-r--r--packages/astro/src/integrations/index.ts2
-rw-r--r--packages/astro/src/vite-plugin-astro-server/base.ts2
-rw-r--r--packages/astro/src/vite-plugin-astro-server/plugin.ts2
-rw-r--r--packages/astro/src/vite-plugin-astro-server/request.ts2
-rw-r--r--packages/astro/src/vite-plugin-astro-server/response.ts2
-rw-r--r--packages/astro/src/vite-plugin-astro-server/route.ts2
-rw-r--r--packages/astro/src/vite-plugin-config-alias/index.ts2
-rw-r--r--packages/astro/src/vite-plugin-env/index.ts2
-rw-r--r--packages/astro/src/vite-plugin-jsx/index.ts2
-rw-r--r--packages/astro/src/vite-plugin-load-fallback/index.ts6
-rw-r--r--packages/astro/src/vite-plugin-utils/index.ts2
59 files changed, 108 insertions, 109 deletions
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts
index 47c7ecb71..af48c4010 100644
--- a/packages/astro/src/@types/astro.ts
+++ b/packages/astro/src/@types/astro.ts
@@ -8,8 +8,8 @@ import type {
ShikiConfig,
} from '@astrojs/markdown-remark';
import type * as babel from '@babel/core';
-import type { OutgoingHttpHeaders } from 'http';
-import type { AddressInfo } from 'net';
+import type { OutgoingHttpHeaders } from 'node:http';
+import type { AddressInfo } from 'node:net';
import type * as rollup from 'rollup';
import type { TsConfigJson } from 'tsconfig-resolver';
import type * as vite from 'vite';
diff --git a/packages/astro/src/assets/services/vendor/squoosh/avif/avif_node_dec.ts b/packages/astro/src/assets/services/vendor/squoosh/avif/avif_node_dec.ts
index b432feefd..9e515108e 100644
--- a/packages/astro/src/assets/services/vendor/squoosh/avif/avif_node_dec.ts
+++ b/packages/astro/src/assets/services/vendor/squoosh/avif/avif_node_dec.ts
@@ -41,13 +41,13 @@ var Module = (function () {
var nodePath
if (ENVIRONMENT_IS_NODE) {
if (ENVIRONMENT_IS_WORKER) {
- scriptDirectory = require('path').dirname(scriptDirectory) + '/'
+ scriptDirectory = require('node:path').dirname(scriptDirectory) + '/'
} else {
scriptDirectory = dirname(getModuleURL(import.meta.url)) + '/'
}
read_ = function shell_read(filename, binary) {
- if (!nodeFS) nodeFS = require('fs')
- if (!nodePath) nodePath = require('path')
+ if (!nodeFS) nodeFS = require('node:fs')
+ if (!nodePath) nodePath = require('node:path')
filename = nodePath['normalize'](filename)
return nodeFS['readFileSync'](filename, binary ? null : 'utf8')
}
diff --git a/packages/astro/src/assets/services/vendor/squoosh/avif/avif_node_enc.ts b/packages/astro/src/assets/services/vendor/squoosh/avif/avif_node_enc.ts
index 933d1a7c9..0236e494b 100644
--- a/packages/astro/src/assets/services/vendor/squoosh/avif/avif_node_enc.ts
+++ b/packages/astro/src/assets/services/vendor/squoosh/avif/avif_node_enc.ts
@@ -41,13 +41,13 @@ var Module = (function () {
var nodePath
if (ENVIRONMENT_IS_NODE) {
if (ENVIRONMENT_IS_WORKER) {
- scriptDirectory = require('path').dirname(scriptDirectory) + '/'
+ scriptDirectory = require('node:path').dirname(scriptDirectory) + '/'
} else {
scriptDirectory = dirname(getModuleURL(import.meta.url)) + '/'
}
read_ = function shell_read(filename, binary) {
- if (!nodeFS) nodeFS = require('fs')
- if (!nodePath) nodePath = require('path')
+ if (!nodeFS) nodeFS = require('node:fs')
+ if (!nodePath) nodePath = require('node:path')
filename = nodePath['normalize'](filename)
return nodeFS['readFileSync'](filename, binary ? null : 'utf8')
}
diff --git a/packages/astro/src/assets/services/vendor/squoosh/image-pool.ts b/packages/astro/src/assets/services/vendor/squoosh/image-pool.ts
index 73bd8545b..839708f03 100644
--- a/packages/astro/src/assets/services/vendor/squoosh/image-pool.ts
+++ b/packages/astro/src/assets/services/vendor/squoosh/image-pool.ts
@@ -1,6 +1,6 @@
+import { cpus } from 'node:os';
+import { fileURLToPath } from 'node:url';
import { isMainThread } from 'node:worker_threads';
-import { cpus } from 'os';
-import { fileURLToPath } from 'url';
import type { ImageOutputFormat } from '../../../types.js';
import { getModuleURL } from './emscripten-utils.js';
import type { Operation } from './image.js';
diff --git a/packages/astro/src/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_dec.ts b/packages/astro/src/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_dec.ts
index 720508a42..f9f2bc6e1 100644
--- a/packages/astro/src/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_dec.ts
+++ b/packages/astro/src/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_dec.ts
@@ -41,13 +41,13 @@ var Module = (function () {
var nodePath
if (ENVIRONMENT_IS_NODE) {
if (ENVIRONMENT_IS_WORKER) {
- scriptDirectory = require('path').dirname(scriptDirectory) + '/'
+ scriptDirectory = require('node:path').dirname(scriptDirectory) + '/'
} else {
scriptDirectory = dirname(getModuleURL(import.meta.url)) + '/'
}
read_ = function shell_read(filename, binary) {
- if (!nodeFS) nodeFS = require('fs')
- if (!nodePath) nodePath = require('path')
+ if (!nodeFS) nodeFS = require('node:fs')
+ if (!nodePath) nodePath = require('node:path')
filename = nodePath['normalize'](filename)
return nodeFS['readFileSync'](filename, binary ? null : 'utf8')
}
diff --git a/packages/astro/src/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_enc.ts b/packages/astro/src/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_enc.ts
index b5fee7365..6adf50e8b 100644
--- a/packages/astro/src/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_enc.ts
+++ b/packages/astro/src/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_enc.ts
@@ -41,13 +41,13 @@ var Module = (function () {
var nodePath
if (ENVIRONMENT_IS_NODE) {
if (ENVIRONMENT_IS_WORKER) {
- scriptDirectory = require('path').dirname(scriptDirectory) + '/'
+ scriptDirectory = require('node:path').dirname(scriptDirectory) + '/'
} else {
scriptDirectory = dirname(getModuleURL(import.meta.url)) + '/'
}
read_ = function shell_read(filename, binary) {
- if (!nodeFS) nodeFS = require('fs')
- if (!nodePath) nodePath = require('path')
+ if (!nodeFS) nodeFS = require('node:fs')
+ if (!nodePath) nodePath = require('node:path')
filename = nodePath['normalize'](filename)
return nodeFS['readFileSync'](filename, binary ? null : 'utf8')
}
diff --git a/packages/astro/src/assets/services/vendor/squoosh/webp/webp_node_dec.ts b/packages/astro/src/assets/services/vendor/squoosh/webp/webp_node_dec.ts
index cdb1a9837..dafa790da 100644
--- a/packages/astro/src/assets/services/vendor/squoosh/webp/webp_node_dec.ts
+++ b/packages/astro/src/assets/services/vendor/squoosh/webp/webp_node_dec.ts
@@ -41,13 +41,13 @@ var Module = (function () {
var nodePath
if (ENVIRONMENT_IS_NODE) {
if (ENVIRONMENT_IS_WORKER) {
- scriptDirectory = require('path').dirname(scriptDirectory) + '/'
+ scriptDirectory = require('node:path').dirname(scriptDirectory) + '/'
} else {
scriptDirectory = dirname(getModuleURL(import.meta.url)) + '/'
}
read_ = function shell_read(filename, binary) {
- if (!nodeFS) nodeFS = require('fs')
- if (!nodePath) nodePath = require('path')
+ if (!nodeFS) nodeFS = require('node:fs')
+ if (!nodePath) nodePath = require('node:path')
filename = nodePath['normalize'](filename)
return nodeFS['readFileSync'](filename, binary ? null : 'utf8')
}
diff --git a/packages/astro/src/assets/services/vendor/squoosh/webp/webp_node_enc.ts b/packages/astro/src/assets/services/vendor/squoosh/webp/webp_node_enc.ts
index d1c350d2b..88d5d267f 100644
--- a/packages/astro/src/assets/services/vendor/squoosh/webp/webp_node_enc.ts
+++ b/packages/astro/src/assets/services/vendor/squoosh/webp/webp_node_enc.ts
@@ -41,13 +41,13 @@ var Module = (function () {
var nodePath
if (ENVIRONMENT_IS_NODE) {
if (ENVIRONMENT_IS_WORKER) {
- scriptDirectory = require('path').dirname(scriptDirectory) + '/'
+ scriptDirectory = require('node:path').dirname(scriptDirectory) + '/'
} else {
scriptDirectory = dirname(getModuleURL(import.meta.url)) + '/'
}
read_ = function shell_read(filename, binary) {
- if (!nodeFS) nodeFS = require('fs')
- if (!nodePath) nodePath = require('path')
+ if (!nodeFS) nodeFS = require('node:fs')
+ if (!nodePath) nodePath = require('node:path')
filename = nodePath['normalize'](filename)
return nodeFS['readFileSync'](filename, binary ? null : 'utf8')
}
diff --git a/packages/astro/src/assets/utils/transformToPath.ts b/packages/astro/src/assets/utils/transformToPath.ts
index c2537b414..04ddee0a1 100644
--- a/packages/astro/src/assets/utils/transformToPath.ts
+++ b/packages/astro/src/assets/utils/transformToPath.ts
@@ -1,4 +1,4 @@
-import { basename, extname } from 'path';
+import { basename, extname } from 'node:path';
import { removeQueryString } from '../../core/path.js';
import { shorthash } from '../../runtime/server/shorthash.js';
import { isESMImportedImage } from '../internal.js';
diff --git a/packages/astro/src/assets/vendor/image-size/index.ts b/packages/astro/src/assets/vendor/image-size/index.ts
index 17edc0281..24f910b33 100644
--- a/packages/astro/src/assets/vendor/image-size/index.ts
+++ b/packages/astro/src/assets/vendor/image-size/index.ts
@@ -1,5 +1,5 @@
-import * as fs from "fs";
-import * as path from "path";
+import * as fs from "node:fs";
+import * as path from "node:path";
import Queue from "../queue/queue.js";
import { detector } from "./detector.js";
import { typeHandlers, type imageType } from "./types.js";
diff --git a/packages/astro/src/assets/vendor/image-size/types/tiff.ts b/packages/astro/src/assets/vendor/image-size/types/tiff.ts
index dcbc9cf55..ae228c1b8 100644
--- a/packages/astro/src/assets/vendor/image-size/types/tiff.ts
+++ b/packages/astro/src/assets/vendor/image-size/types/tiff.ts
@@ -1,6 +1,6 @@
// based on http://www.compix.com/fileformattif.htm
// TO-DO: support big-endian as well
-import * as fs from 'fs'
+import * as fs from 'node:fs'
import { readUInt } from '../readUInt.js'
import type { IImage } from './interface'
diff --git a/packages/astro/src/cli/add/index.ts b/packages/astro/src/cli/add/index.ts
index 33756f378..859fcfb3f 100644
--- a/packages/astro/src/cli/add/index.ts
+++ b/packages/astro/src/cli/add/index.ts
@@ -1,13 +1,13 @@
import boxen from 'boxen';
import { diffWords } from 'diff';
import { execa } from 'execa';
-import fsMod, { existsSync, promises as fs } from 'fs';
import { bold, cyan, dim, green, magenta, red, yellow } from 'kleur/colors';
+import fsMod, { existsSync, promises as fs } from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath, pathToFileURL } from 'node:url';
import ora from 'ora';
-import path from 'path';
import preferredPM from 'preferred-pm';
import prompts from 'prompts';
-import { fileURLToPath, pathToFileURL } from 'url';
import type yargs from 'yargs-parser';
import { loadTSConfig, resolveConfigPath } from '../../core/config/index.js';
import {
diff --git a/packages/astro/src/cli/check/index.ts b/packages/astro/src/cli/check/index.ts
index f188920ac..09d45ee56 100644
--- a/packages/astro/src/cli/check/index.ts
+++ b/packages/astro/src/cli/check/index.ts
@@ -5,12 +5,12 @@ import {
} from '@astrojs/language-server';
import type { FSWatcher } from 'chokidar';
import glob from 'fast-glob';
-import fs from 'fs';
import { bold, dim, red, yellow } from 'kleur/colors';
import { createRequire } from 'module';
+import fs from 'node:fs';
import { join } from 'node:path';
+import { fileURLToPath, pathToFileURL } from 'node:url';
import ora from 'ora';
-import { fileURLToPath, pathToFileURL } from 'url';
import type { Arguments as Flags } from 'yargs-parser';
import type { AstroSettings } from '../../@types/astro';
import type { LogOptions } from '../../core/logger/core.js';
diff --git a/packages/astro/src/cli/check/print.ts b/packages/astro/src/cli/check/print.ts
index 3f637ddcd..21536e7de 100644
--- a/packages/astro/src/cli/check/print.ts
+++ b/packages/astro/src/cli/check/print.ts
@@ -12,7 +12,7 @@ import {
yellow,
} from 'kleur/colors';
import stringWidth from 'string-width';
-import { fileURLToPath } from 'url';
+import { fileURLToPath } from 'node:url';
export function printDiagnostic(filePath: string, text: string, diag: Diagnostic): string {
let result = [];
diff --git a/packages/astro/src/cli/dev/index.ts b/packages/astro/src/cli/dev/index.ts
index ef592cc9c..d3230a05b 100644
--- a/packages/astro/src/cli/dev/index.ts
+++ b/packages/astro/src/cli/dev/index.ts
@@ -1,4 +1,4 @@
-import fs from 'fs';
+import fs from 'node:fs';
import type yargs from 'yargs-parser';
import { resolveConfigPath, resolveFlags } from '../../core/config/index.js';
import devServer from '../../core/dev/index.js';
diff --git a/packages/astro/src/cli/load-settings.ts b/packages/astro/src/cli/load-settings.ts
index a5e9537bf..9b8d90781 100644
--- a/packages/astro/src/cli/load-settings.ts
+++ b/packages/astro/src/cli/load-settings.ts
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
-import fs from 'fs';
import * as colors from 'kleur/colors';
+import fs from 'node:fs';
import type { Arguments as Flags } from 'yargs-parser';
import { ZodError } from 'zod';
import { createSettings, openConfig, resolveConfigPath } from '../core/config/index.js';
diff --git a/packages/astro/src/cli/sync/index.ts b/packages/astro/src/cli/sync/index.ts
index 076372fe2..f96b8fd0b 100644
--- a/packages/astro/src/cli/sync/index.ts
+++ b/packages/astro/src/cli/sync/index.ts
@@ -1,4 +1,4 @@
-import fs from 'fs';
+import fs from 'node:fs';
import type yargs from 'yargs-parser';
import type { LogOptions } from '../../core/logger/core.js';
import { syncCli } from '../../core/sync/index.js';
diff --git a/packages/astro/src/config/index.ts b/packages/astro/src/config/index.ts
index 53183912a..a9e32186d 100644
--- a/packages/astro/src/config/index.ts
+++ b/packages/astro/src/config/index.ts
@@ -22,7 +22,7 @@ export function getViteConfig(inlineConfig: UserConfig) {
{ runHookConfigSetup, runHookConfigDone },
{ astroContentListenPlugin },
] = await Promise.all([
- import('fs'),
+ import('node:fs'),
import('vite'),
import('../core/logger/node.js'),
import('../core/config/index.js'),
diff --git a/packages/astro/src/content/vite-plugin-content-imports.ts b/packages/astro/src/content/vite-plugin-content-imports.ts
index 98ad1ea76..934ef37c6 100644
--- a/packages/astro/src/content/vite-plugin-content-imports.ts
+++ b/packages/astro/src/content/vite-plugin-content-imports.ts
@@ -2,7 +2,7 @@ import * as devalue from 'devalue';
import type fsMod from 'node:fs';
import { extname } from 'node:path';
import type { PluginContext } from 'rollup';
-import { pathToFileURL } from 'url';
+import { pathToFileURL } from 'node:url';
import type { Plugin } from 'vite';
import type {
AstroConfig,
diff --git a/packages/astro/src/core/app/node.ts b/packages/astro/src/core/app/node.ts
index 3e6207309..2cfc686a2 100644
--- a/packages/astro/src/core/app/node.ts
+++ b/packages/astro/src/core/app/node.ts
@@ -1,9 +1,9 @@
import type { RouteData } from '../../@types/astro';
import type { SerializedSSRManifest, SSRManifest } from './types';
-import * as fs from 'fs';
-import { IncomingMessage } from 'http';
-import { TLSSocket } from 'tls';
+import * as fs from 'node:fs';
+import { IncomingMessage } from 'node:http';
+import { TLSSocket } from 'node:tls';
import { deserializeManifest } from './common.js';
import { App, type MatchOptions } from './index.js';
diff --git a/packages/astro/src/core/build/common.ts b/packages/astro/src/core/build/common.ts
index ed0c08d5b..a4ba0b4ca 100644
--- a/packages/astro/src/core/build/common.ts
+++ b/packages/astro/src/core/build/common.ts
@@ -1,5 +1,5 @@
-import npath from 'path';
-import { fileURLToPath, pathToFileURL } from 'url';
+import npath from 'node:path';
+import { fileURLToPath, pathToFileURL } from 'node:url';
import type { AstroConfig, RouteType } from '../../@types/astro';
import { appendForwardSlash } from '../../core/path.js';
diff --git a/packages/astro/src/core/build/css-asset-name.ts b/packages/astro/src/core/build/css-asset-name.ts
index 132df6017..ace31c3ab 100644
--- a/packages/astro/src/core/build/css-asset-name.ts
+++ b/packages/astro/src/core/build/css-asset-name.ts
@@ -1,7 +1,7 @@
import type { GetModuleInfo } from 'rollup';
-import crypto from 'crypto';
-import npath from 'path';
+import crypto from 'node:crypto';
+import npath from 'node:path';
import type { AstroSettings } from '../../@types/astro';
import { viteID } from '../util.js';
import { getTopLevelPages } from './graph.js';
diff --git a/packages/astro/src/core/build/generate.ts b/packages/astro/src/core/build/generate.ts
index 5be11e747..8fde2e0c1 100644
--- a/packages/astro/src/core/build/generate.ts
+++ b/packages/astro/src/core/build/generate.ts
@@ -1,8 +1,8 @@
-import fs from 'fs';
import * as colors from 'kleur/colors';
import { bgGreen, black, cyan, dim, green, magenta } from 'kleur/colors';
+import fs from 'node:fs';
+import { fileURLToPath } from 'node:url';
import type { OutputAsset, OutputChunk } from 'rollup';
-import { fileURLToPath } from 'url';
import type {
AstroConfig,
AstroSettings,
@@ -41,8 +41,8 @@ import { callEndpoint, throwIfRedirectNotAllowed } from '../endpoint/index.js';
import { AstroError, AstroErrorData } from '../errors/index.js';
import { debug, info } from '../logger/core.js';
import {
- getRedirectLocationOrThrow,
RedirectSinglePageBuiltModule,
+ getRedirectLocationOrThrow,
routeIsRedirect,
} from '../redirects/index.js';
import { createEnvironment, createRenderContext, tryRenderPage } from '../render/index.js';
diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts
index 07223d29b..8935c956e 100644
--- a/packages/astro/src/core/build/index.ts
+++ b/packages/astro/src/core/build/index.ts
@@ -1,6 +1,6 @@
-import fs from 'fs';
import * as colors from 'kleur/colors';
-import { performance } from 'perf_hooks';
+import fs from 'node:fs';
+import { performance } from 'node:perf_hooks';
import type * as vite from 'vite';
import type yargs from 'yargs-parser';
import type { AstroConfig, AstroSettings, ManifestData, RuntimeMode } from '../../@types/astro';
diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts
index 6065a5007..8e3cf8fa8 100644
--- a/packages/astro/src/core/build/static-build.ts
+++ b/packages/astro/src/core/build/static-build.ts
@@ -1,11 +1,10 @@
import { teardown } from '@astrojs/compiler';
import * as eslexer from 'es-module-lexer';
import glob from 'fast-glob';
-import fs from 'fs';
import { bgGreen, bgMagenta, black, dim } from 'kleur/colors';
-import { extname } from 'node:path';
-import path from 'path';
-import { fileURLToPath } from 'url';
+import fs from 'node:fs';
+import path, { extname } from 'node:path';
+import { fileURLToPath } from 'node:url';
import * as vite from 'vite';
import type { RouteData } from '../../@types/astro';
import {
diff --git a/packages/astro/src/core/compile/compile.ts b/packages/astro/src/core/compile/compile.ts
index 425677123..a0bc79c72 100644
--- a/packages/astro/src/core/compile/compile.ts
+++ b/packages/astro/src/core/compile/compile.ts
@@ -3,7 +3,7 @@ import type { ResolvedConfig } from 'vite';
import type { AstroConfig } from '../../@types/astro';
import { transform } from '@astrojs/compiler';
-import { fileURLToPath } from 'url';
+import { fileURLToPath } from 'node:url';
import { normalizePath } from 'vite';
import { AggregateError, AstroError, CompilerError } from '../errors/errors.js';
import { AstroErrorData } from '../errors/index.js';
diff --git a/packages/astro/src/core/compile/style.ts b/packages/astro/src/core/compile/style.ts
index 347f83029..7ecb89122 100644
--- a/packages/astro/src/core/compile/style.ts
+++ b/packages/astro/src/core/compile/style.ts
@@ -1,5 +1,5 @@
import type { TransformOptions } from '@astrojs/compiler';
-import fs from 'fs';
+import fs from 'node:fs';
import { preprocessCSS, type ResolvedConfig } from 'vite';
import { AstroErrorData, CSSError, positionAt } from '../errors/index.js';
diff --git a/packages/astro/src/core/config/config.ts b/packages/astro/src/core/config/config.ts
index b04aae727..e5fa8d5b0 100644
--- a/packages/astro/src/core/config/config.ts
+++ b/packages/astro/src/core/config/config.ts
@@ -1,10 +1,10 @@
import type { Arguments as Flags } from 'yargs-parser';
import type { AstroConfig, AstroUserConfig, CLIFlags } from '../../@types/astro';
-import fs from 'fs';
import * as colors from 'kleur/colors';
-import path from 'path';
-import { fileURLToPath, pathToFileURL } from 'url';
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath, pathToFileURL } from 'node:url';
import { AstroError, AstroErrorData } from '../errors/index.js';
import { mergeConfig } from './merge.js';
import { createRelativeSchema } from './schema.js';
diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts
index 5b559e444..16bfbbac7 100644
--- a/packages/astro/src/core/config/schema.ts
+++ b/packages/astro/src/core/config/schema.ts
@@ -3,7 +3,7 @@ import { markdownConfigDefaults } from '@astrojs/markdown-remark';
import type { ILanguageRegistration, IThemeRegistration, Theme } from 'shiki';
import type { AstroUserConfig, ViteUserConfig } from '../../@types/astro';
-import type { OutgoingHttpHeaders } from 'http';
+import type { OutgoingHttpHeaders } from 'node:http';
import { BUNDLED_THEMES } from 'shiki';
import { z } from 'zod';
import { appendForwardSlash, prependForwardSlash, trimSlashes } from '../path.js';
diff --git a/packages/astro/src/core/config/settings.ts b/packages/astro/src/core/config/settings.ts
index 8040b3fbe..983b4566b 100644
--- a/packages/astro/src/core/config/settings.ts
+++ b/packages/astro/src/core/config/settings.ts
@@ -1,6 +1,6 @@
import yaml from 'js-yaml';
import path from 'node:path';
-import { fileURLToPath, pathToFileURL } from 'url';
+import { fileURLToPath, pathToFileURL } from 'node:url';
import type { AstroConfig, AstroSettings, AstroUserConfig } from '../../@types/astro';
import { getContentPaths } from '../../content/index.js';
import jsxRenderer from '../../jsx/renderer.js';
diff --git a/packages/astro/src/core/config/timer.ts b/packages/astro/src/core/config/timer.ts
index 82860e0a7..d41009b11 100644
--- a/packages/astro/src/core/config/timer.ts
+++ b/packages/astro/src/core/config/timer.ts
@@ -1,4 +1,4 @@
-import fs from 'fs';
+import fs from 'node:fs';
// Type used by `bench-memory.js`
export interface Stat {
diff --git a/packages/astro/src/core/config/tsconfig.ts b/packages/astro/src/core/config/tsconfig.ts
index 7ffb88087..5a5d3fc64 100644
--- a/packages/astro/src/core/config/tsconfig.ts
+++ b/packages/astro/src/core/config/tsconfig.ts
@@ -1,6 +1,6 @@
import { deepmerge } from 'deepmerge-ts';
-import { existsSync } from 'fs';
-import { join } from 'path';
+import { existsSync } from 'node:fs';
+import { join } from 'node:path';
import * as tsr from 'tsconfig-resolver';
export const defaultTSConfig: tsr.TsConfigJson = { extends: 'astro/tsconfigs/base' };
diff --git a/packages/astro/src/core/config/vite-load.ts b/packages/astro/src/core/config/vite-load.ts
index 86e3cf80e..8ef15d9a2 100644
--- a/packages/astro/src/core/config/vite-load.ts
+++ b/packages/astro/src/core/config/vite-load.ts
@@ -1,5 +1,5 @@
-import type fsType from 'fs';
-import { pathToFileURL } from 'url';
+import type fsType from 'node:fs';
+import { pathToFileURL } from 'node:url';
import { createServer, type ViteDevServer } from 'vite';
import loadFallbackPlugin from '../../vite-plugin-load-fallback/index.js';
import { debug } from '../logger/core.js';
diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts
index 60c847045..279a7ffde 100644
--- a/packages/astro/src/core/create-vite.ts
+++ b/packages/astro/src/core/create-vite.ts
@@ -1,8 +1,8 @@
import type { AstroSettings } from '../@types/astro';
import type { LogOptions } from './logger/core';
-import nodeFs from 'fs';
-import { fileURLToPath } from 'url';
+import nodeFs from 'node:fs';
+import { fileURLToPath } from 'node:url';
import * as vite from 'vite';
import { crawlFrameworkPkgs } from 'vitefu';
import astroAssetsPlugin from '../assets/vite-plugin-assets.js';
diff --git a/packages/astro/src/core/dev/container.ts b/packages/astro/src/core/dev/container.ts
index 4a1d6cc6b..8f922c6dd 100644
--- a/packages/astro/src/core/dev/container.ts
+++ b/packages/astro/src/core/dev/container.ts
@@ -1,8 +1,8 @@
-import type * as http from 'http';
-import type { AddressInfo } from 'net';
+import type * as http from 'node:http';
+import type { AddressInfo } from 'node:net';
import type { AstroSettings, AstroUserConfig } from '../../@types/astro';
-import nodeFs from 'fs';
+import nodeFs from 'node:fs';
import * as vite from 'vite';
import {
runHookConfigDone,
diff --git a/packages/astro/src/core/dev/dev.ts b/packages/astro/src/core/dev/dev.ts
index 5308eaf6b..f6fd35685 100644
--- a/packages/astro/src/core/dev/dev.ts
+++ b/packages/astro/src/core/dev/dev.ts
@@ -1,6 +1,6 @@
-import type http from 'http';
import { cyan } from 'kleur/colors';
-import type { AddressInfo } from 'net';
+import type http from 'node:http';
+import type { AddressInfo } from 'node:net';
import { performance } from 'perf_hooks';
import type * as vite from 'vite';
import type yargs from 'yargs-parser';
diff --git a/packages/astro/src/core/errors/dev/vite.ts b/packages/astro/src/core/errors/dev/vite.ts
index cb19ca8f6..30b3d44b3 100644
--- a/packages/astro/src/core/errors/dev/vite.ts
+++ b/packages/astro/src/core/errors/dev/vite.ts
@@ -1,6 +1,6 @@
-import * as fs from 'fs';
+import * as fs from 'node:fs';
+import { fileURLToPath } from 'node:url';
import { getHighlighter } from 'shiki';
-import { fileURLToPath } from 'url';
import type { ErrorPayload } from 'vite';
import type { ModuleLoader } from '../../module-loader/index.js';
import { AstroErrorData } from '../errors-data.js';
diff --git a/packages/astro/src/core/fs/index.ts b/packages/astro/src/core/fs/index.ts
index 35afde043..9eff473e2 100644
--- a/packages/astro/src/core/fs/index.ts
+++ b/packages/astro/src/core/fs/index.ts
@@ -1,6 +1,6 @@
-import fs from 'fs';
-import path from 'path';
-import { fileURLToPath } from 'url';
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
import { appendForwardSlash } from '../path.js';
const isWindows = process.platform === 'win32';
@@ -63,7 +63,7 @@ export function emptyDir(_dir: URL, skip?: Set<string>): void {
* Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
diff --git a/packages/astro/src/core/logger/node.ts b/packages/astro/src/core/logger/node.ts
index 29ce110f2..513ba257e 100644
--- a/packages/astro/src/core/logger/node.ts
+++ b/packages/astro/src/core/logger/node.ts
@@ -1,7 +1,7 @@
import debugPackage from 'debug';
import { bold, cyan, dim, red, reset, yellow } from 'kleur/colors';
-import * as readline from 'readline';
-import { Writable } from 'stream';
+import * as readline from 'node:readline';
+import { Writable } from 'node:stream';
import stringWidth from 'string-width';
import { dateTimeFormat, error, info, warn } from './core.js';
diff --git a/packages/astro/src/core/module-loader/loader.ts b/packages/astro/src/core/module-loader/loader.ts
index 449aff80e..c686cef03 100644
--- a/packages/astro/src/core/module-loader/loader.ts
+++ b/packages/astro/src/core/module-loader/loader.ts
@@ -1,5 +1,5 @@
-import { EventEmitter } from 'events';
-import type * as fs from 'fs';
+import { EventEmitter } from 'node:events';
+import type * as fs from 'node:fs';
import type { TypedEventEmitter } from '../../@types/typed-emitter';
// This is a generic interface for a module loader. In the astro cli this is
diff --git a/packages/astro/src/core/module-loader/vite.ts b/packages/astro/src/core/module-loader/vite.ts
index af1d8d070..88ad03cf7 100644
--- a/packages/astro/src/core/module-loader/vite.ts
+++ b/packages/astro/src/core/module-loader/vite.ts
@@ -1,4 +1,4 @@
-import { EventEmitter } from 'events';
+import { EventEmitter } from 'node:events';
import type * as vite from 'vite';
import type { ModuleLoader, ModuleLoaderEventEmitter } from './loader';
diff --git a/packages/astro/src/core/preview/index.ts b/packages/astro/src/core/preview/index.ts
index 492afe03f..d47e54499 100644
--- a/packages/astro/src/core/preview/index.ts
+++ b/packages/astro/src/core/preview/index.ts
@@ -1,6 +1,6 @@
import { cyan } from 'kleur/colors';
import { createRequire } from 'module';
-import { pathToFileURL } from 'url';
+import { pathToFileURL } from 'node:url';
import type { Arguments } from 'yargs-parser';
import type { AstroSettings, PreviewModule, PreviewServer } from '../../@types/astro';
import { runHookConfigDone, runHookConfigSetup } from '../../integrations/index.js';
diff --git a/packages/astro/src/core/preview/static-preview-server.ts b/packages/astro/src/core/preview/static-preview-server.ts
index b908f7437..1fdc90c2a 100644
--- a/packages/astro/src/core/preview/static-preview-server.ts
+++ b/packages/astro/src/core/preview/static-preview-server.ts
@@ -1,7 +1,7 @@
-import type http from 'http';
+import type http from 'node:http';
+import { fileURLToPath } from 'node:url';
import { performance } from 'perf_hooks';
import enableDestroy from 'server-destroy';
-import { fileURLToPath } from 'url';
import { preview, type PreviewServer as VitePreviewServer } from 'vite';
import type { AstroSettings } from '../../@types/astro';
import type { LogOptions } from '../logger/core';
diff --git a/packages/astro/src/core/preview/vite-plugin-astro-preview.ts b/packages/astro/src/core/preview/vite-plugin-astro-preview.ts
index 1d2453b46..1f9f7c86f 100644
--- a/packages/astro/src/core/preview/vite-plugin-astro-preview.ts
+++ b/packages/astro/src/core/preview/vite-plugin-astro-preview.ts
@@ -1,5 +1,5 @@
-import fs from 'fs';
-import { fileURLToPath } from 'url';
+import fs from 'node:fs';
+import { fileURLToPath } from 'node:url';
import type { Plugin } from 'vite';
import type { AstroSettings } from '../../@types/astro.js';
import { notFoundTemplate, subpathNotUsedTemplate } from '../../template/4xx.js';
diff --git a/packages/astro/src/core/render/dev/vite.ts b/packages/astro/src/core/render/dev/vite.ts
index 506d77a88..252d50fa2 100644
--- a/packages/astro/src/core/render/dev/vite.ts
+++ b/packages/astro/src/core/render/dev/vite.ts
@@ -1,6 +1,6 @@
import type { ModuleLoader, ModuleNode } from '../../module-loader/index';
-import npath from 'path';
+import npath from 'node:path';
import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from '../../constants.js';
import { unwrapId } from '../../util.js';
import { isCSSRequest } from './util.js';
diff --git a/packages/astro/src/core/request.ts b/packages/astro/src/core/request.ts
index d229ceaa4..36222c7b6 100644
--- a/packages/astro/src/core/request.ts
+++ b/packages/astro/src/core/request.ts
@@ -1,4 +1,4 @@
-import type { IncomingHttpHeaders } from 'http';
+import type { IncomingHttpHeaders } from 'node:http';
import type { LogOptions } from './logger/core';
import { warn } from './logger/core.js';
diff --git a/packages/astro/src/core/routing/manifest/create.ts b/packages/astro/src/core/routing/manifest/create.ts
index 70a59be59..e669f293b 100644
--- a/packages/astro/src/core/routing/manifest/create.ts
+++ b/packages/astro/src/core/routing/manifest/create.ts
@@ -8,10 +8,10 @@ import type {
} from '../../../@types/astro';
import type { LogOptions } from '../../logger/core';
-import nodeFs from 'fs';
import { createRequire } from 'module';
-import path from 'path';
-import { fileURLToPath } from 'url';
+import nodeFs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
import { getPrerenderDefault } from '../../../prerender/utils.js';
import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from '../../constants.js';
import { warn } from '../../logger/core.js';
diff --git a/packages/astro/src/core/util.ts b/packages/astro/src/core/util.ts
index 2529e89c2..e27348dcb 100644
--- a/packages/astro/src/core/util.ts
+++ b/packages/astro/src/core/util.ts
@@ -1,6 +1,6 @@
-import fs from 'fs';
-import path from 'path';
-import { fileURLToPath } from 'url';
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
import { normalizePath } from 'vite';
import type { AstroConfig, AstroSettings, RouteType } from '../@types/astro';
import { isServerLikeOutput } from '../prerender/utils.js';
diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts
index ba8bcc1ef..cf50df0e1 100644
--- a/packages/astro/src/integrations/index.ts
+++ b/packages/astro/src/integrations/index.ts
@@ -1,6 +1,6 @@
import { bold } from 'kleur/colors';
-import type { AddressInfo } from 'net';
import fs from 'node:fs';
+import type { AddressInfo } from 'node:net';
import { fileURLToPath } from 'node:url';
import type { InlineConfig, ViteDevServer } from 'vite';
import type {
diff --git a/packages/astro/src/vite-plugin-astro-server/base.ts b/packages/astro/src/vite-plugin-astro-server/base.ts
index b3be80b3c..f9e1c3fe4 100644
--- a/packages/astro/src/vite-plugin-astro-server/base.ts
+++ b/packages/astro/src/vite-plugin-astro-server/base.ts
@@ -1,7 +1,7 @@
import type * as vite from 'vite';
import type { AstroSettings } from '../@types/astro';
-import * as fs from 'fs';
+import * as fs from 'node:fs';
import { warn, type LogOptions } from '../core/logger/core.js';
import notFoundTemplate, { subpathNotUsedTemplate } from '../template/4xx.js';
import { log404 } from './common.js';
diff --git a/packages/astro/src/vite-plugin-astro-server/plugin.ts b/packages/astro/src/vite-plugin-astro-server/plugin.ts
index ffae6e05b..69e2186a5 100644
--- a/packages/astro/src/vite-plugin-astro-server/plugin.ts
+++ b/packages/astro/src/vite-plugin-astro-server/plugin.ts
@@ -1,4 +1,4 @@
-import type fs from 'fs';
+import type fs from 'node:fs';
import type * as vite from 'vite';
import type { AstroSettings, ManifestData, SSRManifest } from '../@types/astro';
import { patchOverlay } from '../core/errors/overlay.js';
diff --git a/packages/astro/src/vite-plugin-astro-server/request.ts b/packages/astro/src/vite-plugin-astro-server/request.ts
index df9655c75..b0696adc5 100644
--- a/packages/astro/src/vite-plugin-astro-server/request.ts
+++ b/packages/astro/src/vite-plugin-astro-server/request.ts
@@ -1,4 +1,4 @@
-import type http from 'http';
+import type http from 'node:http';
import type { ManifestData, SSRManifest } from '../@types/astro';
import type { DevelopmentEnvironment } from '../core/render/dev/index';
import type { DevServerController } from './controller';
diff --git a/packages/astro/src/vite-plugin-astro-server/response.ts b/packages/astro/src/vite-plugin-astro-server/response.ts
index b1ac9d3cd..9e74a754f 100644
--- a/packages/astro/src/vite-plugin-astro-server/response.ts
+++ b/packages/astro/src/vite-plugin-astro-server/response.ts
@@ -1,4 +1,4 @@
-import type http from 'http';
+import type http from 'node:http';
import type { ErrorWithMetadata } from '../core/errors/index.js';
import type { ModuleLoader } from '../core/module-loader/index';
diff --git a/packages/astro/src/vite-plugin-astro-server/route.ts b/packages/astro/src/vite-plugin-astro-server/route.ts
index 388ce7743..4c9b8782b 100644
--- a/packages/astro/src/vite-plugin-astro-server/route.ts
+++ b/packages/astro/src/vite-plugin-astro-server/route.ts
@@ -1,5 +1,5 @@
-import type http from 'http';
import mime from 'mime';
+import type http from 'node:http';
import type { ComponentInstance, ManifestData, RouteData, SSRManifest } from '../@types/astro';
import { attachToResponse } from '../core/cookies/index.js';
import { call as callEndpoint } from '../core/endpoint/dev/index.js';
diff --git a/packages/astro/src/vite-plugin-config-alias/index.ts b/packages/astro/src/vite-plugin-config-alias/index.ts
index d124dd687..0df989c8c 100644
--- a/packages/astro/src/vite-plugin-config-alias/index.ts
+++ b/packages/astro/src/vite-plugin-config-alias/index.ts
@@ -1,4 +1,4 @@
-import path from 'path';
+import path from 'node:path';
import { normalizePath, type Plugin as VitePlugin, type ResolvedConfig } from 'vite';
import type { AstroSettings } from '../@types/astro';
diff --git a/packages/astro/src/vite-plugin-env/index.ts b/packages/astro/src/vite-plugin-env/index.ts
index 75a37d693..57a1ada63 100644
--- a/packages/astro/src/vite-plugin-env/index.ts
+++ b/packages/astro/src/vite-plugin-env/index.ts
@@ -1,5 +1,5 @@
import MagicString from 'magic-string';
-import { fileURLToPath } from 'url';
+import { fileURLToPath } from 'node:url';
import type * as vite from 'vite';
import { loadEnv } from 'vite';
import type { AstroConfig, AstroSettings } from '../@types/astro';
diff --git a/packages/astro/src/vite-plugin-jsx/index.ts b/packages/astro/src/vite-plugin-jsx/index.ts
index 9364a4e0b..eb5ea7631 100644
--- a/packages/astro/src/vite-plugin-jsx/index.ts
+++ b/packages/astro/src/vite-plugin-jsx/index.ts
@@ -11,7 +11,7 @@ import type { PluginMetadata } from '../vite-plugin-astro/types';
import babel from '@babel/core';
import * as colors from 'kleur/colors';
-import path from 'path';
+import path from 'node:path';
import { CONTENT_FLAG, PROPAGATED_ASSET_FLAG } from '../content/index.js';
import { astroEntryPrefix } from '../core/build/plugins/plugin-component-entry.js';
import { error } from '../core/logger/core.js';
diff --git a/packages/astro/src/vite-plugin-load-fallback/index.ts b/packages/astro/src/vite-plugin-load-fallback/index.ts
index 084cb885f..e11f317ca 100644
--- a/packages/astro/src/vite-plugin-load-fallback/index.ts
+++ b/packages/astro/src/vite-plugin-load-fallback/index.ts
@@ -1,5 +1,5 @@
-import nodeFs from 'fs';
-import npath from 'path';
+import nodeFs from 'node:fs';
+import npath from 'node:path';
import type * as vite from 'vite';
import { slash } from '../core/path.js';
@@ -15,7 +15,7 @@ export default function loadFallbackPlugin({
root,
}: LoadFallbackPluginParams): vite.Plugin[] | false {
// Only add this plugin if a custom fs implementation is provided.
- // Also check for `fs.default` because `import * as fs from 'fs'` will
+ // Also check for `fs.default` because `import * as fs from 'node:fs'` will
// export as so, which only it's `.default` would === `nodeFs`.
// @ts-expect-error check default
if (!fs || fs === nodeFs || fs.default === nodeFs) {
diff --git a/packages/astro/src/vite-plugin-utils/index.ts b/packages/astro/src/vite-plugin-utils/index.ts
index b9cc60576..468360372 100644
--- a/packages/astro/src/vite-plugin-utils/index.ts
+++ b/packages/astro/src/vite-plugin-utils/index.ts
@@ -1,5 +1,5 @@
import ancestor from 'common-ancestor-path';
-import { fileURLToPath } from 'url';
+import { fileURLToPath } from 'node:url';
import type { AstroConfig } from '../@types/astro';
import {
appendExtension,