astro 2.4.4 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,12 @@ import { Readable } from "node:stream";
|
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import { normalizePath } from "vite";
|
|
8
8
|
import { error } from "../core/logger/core.js";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
appendForwardSlash,
|
|
11
|
+
joinPaths,
|
|
12
|
+
prependForwardSlash,
|
|
13
|
+
removeQueryString
|
|
14
|
+
} from "../core/path.js";
|
|
10
15
|
import { VIRTUAL_MODULE_ID, VIRTUAL_SERVICE_ID } from "./consts.js";
|
|
11
16
|
import { isESMImportedImage } from "./internal.js";
|
|
12
17
|
import { isLocalService } from "./services/service.js";
|
|
@@ -184,7 +189,8 @@ function assets({
|
|
|
184
189
|
resolvedConfig = viteConfig;
|
|
185
190
|
},
|
|
186
191
|
async load(id) {
|
|
187
|
-
|
|
192
|
+
const cleanedUrl = removeQueryString(id);
|
|
193
|
+
if (/\.(jpeg|jpg|png|tiff|webp|gif|svg)$/.test(cleanedUrl)) {
|
|
188
194
|
const meta = await emitESMImage(id, this.meta.watchMode, this.emitFile, settings);
|
|
189
195
|
return `export default ${JSON.stringify(meta)}`;
|
|
190
196
|
}
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -53,7 +53,7 @@ async function dev(settings, options) {
|
|
|
53
53
|
isRestart: options.isRestart
|
|
54
54
|
})
|
|
55
55
|
);
|
|
56
|
-
const currentVersion = "2.4.
|
|
56
|
+
const currentVersion = "2.4.5";
|
|
57
57
|
if (currentVersion.includes("-")) {
|
|
58
58
|
warn(options.logging, null, msg.prerelease({ currentVersion }));
|
|
59
59
|
}
|
package/dist/core/messages.js
CHANGED
|
@@ -47,7 +47,7 @@ function serverStart({
|
|
|
47
47
|
base,
|
|
48
48
|
isRestart = false
|
|
49
49
|
}) {
|
|
50
|
-
const version = "2.4.
|
|
50
|
+
const version = "2.4.5";
|
|
51
51
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
52
52
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
53
53
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -233,7 +233,7 @@ function printHelp({
|
|
|
233
233
|
message.push(
|
|
234
234
|
linebreak(),
|
|
235
235
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
236
|
-
`v${"2.4.
|
|
236
|
+
`v${"2.4.5"}`
|
|
237
237
|
)} ${headline}`
|
|
238
238
|
);
|
|
239
239
|
}
|
|
@@ -5,20 +5,22 @@ const getConfigAlias = (settings) => {
|
|
|
5
5
|
if (!tsConfig || !tsConfigPath || !tsConfig.compilerOptions)
|
|
6
6
|
return null;
|
|
7
7
|
const { baseUrl, paths } = tsConfig.compilerOptions;
|
|
8
|
-
if (!baseUrl
|
|
8
|
+
if (!baseUrl)
|
|
9
9
|
return null;
|
|
10
10
|
const resolvedBaseUrl = path.resolve(path.dirname(tsConfigPath), baseUrl);
|
|
11
11
|
const aliases = [];
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
if (paths) {
|
|
13
|
+
for (const [alias, values] of Object.entries(paths)) {
|
|
14
|
+
const find = new RegExp(
|
|
15
|
+
`^${[...alias].map(
|
|
16
|
+
(segment) => segment === "*" ? "(.+)" : segment.replace(/[\\^$*+?.()|[\]{}]/, "\\$&")
|
|
17
|
+
).join("")}$`
|
|
18
|
+
);
|
|
19
|
+
let matchId = 0;
|
|
20
|
+
for (const value of values) {
|
|
21
|
+
const replacement = [...normalizePath(path.resolve(resolvedBaseUrl, value))].map((segment) => segment === "*" ? `$${++matchId}` : segment === "$" ? "$$" : segment).join("");
|
|
22
|
+
aliases.push({ find, replacement });
|
|
23
|
+
}
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
aliases.push({
|