astro 3.3.1 → 3.3.2
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.
package/dist/@types/astro.d.ts
CHANGED
|
@@ -506,7 +506,28 @@ export interface AstroUserConfig {
|
|
|
506
506
|
*
|
|
507
507
|
* When using this option, all of your static asset imports and URLs should add the base as a prefix. You can access this value via `import.meta.env.BASE_URL`.
|
|
508
508
|
*
|
|
509
|
-
* The value of `import.meta.env.BASE_URL`
|
|
509
|
+
* The value of `import.meta.env.BASE_URL` will be determined by your `trailingSlash` config, no matter what value you have set for `base`.
|
|
510
|
+
*
|
|
511
|
+
* A trailing slash is always included if `trailingSlash: "always"` is set. If `trailingSlash: "never"` is set, `BASE_URL` will not include a trailing slash, even if `base` includes one.
|
|
512
|
+
*
|
|
513
|
+
* Additionally, Astro will internally manipulate the configured value of `config.base` before making it available to integrations. The value of `config.base` as read by integrations will also be determined by your `trailingSlash` configuration in the same way.
|
|
514
|
+
*
|
|
515
|
+
* In the example below, the values of `import.meta.env.BASE_URL` and `config.base` when processed will both be `/docs`:
|
|
516
|
+
* ```js
|
|
517
|
+
* {
|
|
518
|
+
* base: '/docs/',
|
|
519
|
+
* trailingSlash: "never"
|
|
520
|
+
* }
|
|
521
|
+
* ```
|
|
522
|
+
*
|
|
523
|
+
* In the example below, the values of `import.meta.env.BASE_URL` and `config.base` when processed will both be `/docs/`:
|
|
524
|
+
*
|
|
525
|
+
* ```js
|
|
526
|
+
* {
|
|
527
|
+
* base: '/docs',
|
|
528
|
+
* trailingSlash: "always"
|
|
529
|
+
* }
|
|
530
|
+
* ```
|
|
510
531
|
*/
|
|
511
532
|
base?: string;
|
|
512
533
|
/**
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { isRemotePath, removeQueryString } from "@astrojs/internal-helpers/path";
|
|
2
2
|
import { readFile } from "fs/promises";
|
|
3
3
|
import mime from "mime/lite.js";
|
|
4
|
+
import os from "os";
|
|
4
5
|
import { getConfiguredImageService, isRemoteAllowed } from "../internal.js";
|
|
5
6
|
import { etag } from "../utils/etag.js";
|
|
6
7
|
import { assetsDir, imageConfig } from "astro:assets";
|
|
8
|
+
function replaceFileSystemReferences(src) {
|
|
9
|
+
return os.platform().includes("win32") ? src.replace(/^\/@fs\//, "") : src.replace(/^\/@fs/, "");
|
|
10
|
+
}
|
|
7
11
|
async function loadLocalImage(src, url) {
|
|
8
|
-
const filePath = import.meta.env.DEV ? removeQueryString(src
|
|
12
|
+
const filePath = import.meta.env.DEV ? removeQueryString(replaceFileSystemReferences(src)) : new URL("." + src, assetsDir);
|
|
9
13
|
let buffer = void 0;
|
|
10
14
|
try {
|
|
11
15
|
buffer = await readFile(filePath);
|
package/dist/core/constants.js
CHANGED
package/dist/core/create-vite.js
CHANGED
|
@@ -69,6 +69,8 @@ async function createVite(commandConfig, { settings, logger, mode, command, fs =
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
const commonConfig = {
|
|
72
|
+
// Tell Vite not to combine config from vite.config.js with our provided inline config
|
|
73
|
+
configFile: false,
|
|
72
74
|
cacheDir: fileURLToPath(new URL("./node_modules/.vite/", settings.config.root)),
|
|
73
75
|
// using local caches allows Astro to be used in monorepos, etc.
|
|
74
76
|
clearScreen: false,
|
package/dist/core/dev/dev.js
CHANGED
|
@@ -20,7 +20,7 @@ async function dev(inlineConfig) {
|
|
|
20
20
|
base: restart.container.settings.config.base
|
|
21
21
|
})
|
|
22
22
|
);
|
|
23
|
-
const currentVersion = "3.3.
|
|
23
|
+
const currentVersion = "3.3.2";
|
|
24
24
|
if (currentVersion.includes("-")) {
|
|
25
25
|
logger.warn(null, msg.prerelease({ currentVersion }));
|
|
26
26
|
}
|
package/dist/core/messages.js
CHANGED
|
@@ -50,7 +50,7 @@ function serverStart({
|
|
|
50
50
|
base,
|
|
51
51
|
isRestart = false
|
|
52
52
|
}) {
|
|
53
|
-
const version = "3.3.
|
|
53
|
+
const version = "3.3.2";
|
|
54
54
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
55
55
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
56
56
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -235,7 +235,7 @@ function printHelp({
|
|
|
235
235
|
message.push(
|
|
236
236
|
linebreak(),
|
|
237
237
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
238
|
-
`v${"3.3.
|
|
238
|
+
`v${"3.3.2"}`
|
|
239
239
|
)} ${headline}`
|
|
240
240
|
);
|
|
241
241
|
}
|