astro 2.2.2 → 2.2.3
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/assets/services/vendor/squoosh/avif/avif_node_dec.wasm.d.ts +3 -0
- package/dist/assets/services/vendor/squoosh/avif/avif_node_dec.wasm.js +4 -0
- package/dist/assets/services/vendor/squoosh/avif/avif_node_enc.wasm.d.ts +3 -0
- package/dist/assets/services/vendor/squoosh/avif/avif_node_enc.wasm.js +4 -0
- package/dist/assets/services/vendor/squoosh/codecs.js +24 -25
- package/dist/assets/services/vendor/squoosh/emscripten-utils.d.ts +2 -2
- package/dist/assets/services/vendor/squoosh/emscripten-utils.js +6 -8
- package/dist/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_dec.wasm.d.ts +3 -0
- package/dist/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_dec.wasm.js +4 -0
- package/dist/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_enc.wasm.d.ts +3 -0
- package/dist/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_enc.wasm.js +4 -0
- package/dist/assets/services/vendor/squoosh/png/squoosh_oxipng_bg.wasm.d.ts +3 -0
- package/dist/assets/services/vendor/squoosh/png/squoosh_oxipng_bg.wasm.js +4 -0
- package/dist/assets/services/vendor/squoosh/png/squoosh_png_bg.wasm.d.ts +3 -0
- package/dist/assets/services/vendor/squoosh/png/squoosh_png_bg.wasm.js +4 -0
- package/dist/assets/services/vendor/squoosh/resize/squoosh_resize_bg.wasm.d.ts +3 -0
- package/dist/assets/services/vendor/squoosh/resize/squoosh_resize_bg.wasm.js +4 -0
- package/dist/assets/services/vendor/squoosh/rotate/rotate.wasm.d.ts +3 -0
- package/dist/assets/services/vendor/squoosh/rotate/rotate.wasm.js +4 -0
- package/dist/assets/services/vendor/squoosh/webp/webp_node_dec.wasm.d.ts +3 -0
- package/dist/assets/services/vendor/squoosh/webp/webp_node_dec.wasm.js +4 -0
- package/dist/assets/services/vendor/squoosh/webp/webp_node_enc.wasm.d.ts +3 -0
- package/dist/assets/services/vendor/squoosh/webp/webp_node_enc.wasm.js +4 -0
- package/dist/assets/vite-plugin-assets.js +0 -10
- package/dist/content/index.d.ts +1 -0
- package/dist/content/index.js +3 -0
- package/dist/content/vite-plugin-content-assets.js +33 -34
- package/dist/content/vite-plugin-content-imports.js +17 -23
- package/dist/core/build/generate.js +0 -4
- package/dist/core/build/plugins/plugin-css.js +7 -9
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/runtime/server/render/slot.js +1 -1
- package/dist/vite-plugin-jsx/index.js +7 -0
- package/package.json +1 -1
- package/dist/assets/services/vendor/squoosh/copy-wasm.d.ts +0 -2
- package/dist/assets/services/vendor/squoosh/copy-wasm.js +0 -37
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getModuleURL, instantiateEmscriptenWasm, pathify } from "./emscripten-utils.js";
|
|
3
|
-
import mozEnc from "./mozjpeg/mozjpeg_node_enc.js";
|
|
4
|
-
const mozEncWasm = new URL("./mozjpeg/mozjpeg_node_enc.wasm", getModuleURL(import.meta.url));
|
|
1
|
+
import { instantiateEmscriptenWasm } from "./emscripten-utils.js";
|
|
5
2
|
import mozDec from "./mozjpeg/mozjpeg_node_dec.js";
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
3
|
+
import mozDecWasm from "./mozjpeg/mozjpeg_node_dec.wasm.js";
|
|
4
|
+
import mozEnc from "./mozjpeg/mozjpeg_node_enc.js";
|
|
5
|
+
import mozEncWasm from "./mozjpeg/mozjpeg_node_enc.wasm.js";
|
|
9
6
|
import webpDec from "./webp/webp_node_dec.js";
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
|
|
7
|
+
import webpDecWasm from "./webp/webp_node_dec.wasm.js";
|
|
8
|
+
import webpEnc from "./webp/webp_node_enc.js";
|
|
9
|
+
import webpEncWasm from "./webp/webp_node_enc.wasm.js";
|
|
13
10
|
import avifDec from "./avif/avif_node_dec.js";
|
|
14
|
-
|
|
11
|
+
import avifDecWasm from "./avif/avif_node_dec.wasm.js";
|
|
12
|
+
import avifEnc from "./avif/avif_node_enc.js";
|
|
13
|
+
import avifEncWasm from "./avif/avif_node_enc.wasm.js";
|
|
15
14
|
import * as pngEncDec from "./png/squoosh_png.js";
|
|
16
|
-
|
|
17
|
-
const pngEncDecInit = () => pngEncDec.default(
|
|
15
|
+
import pngEncDecWasm from "./png/squoosh_png_bg.wasm.js";
|
|
16
|
+
const pngEncDecInit = () => pngEncDec.default(pngEncDecWasm);
|
|
18
17
|
import * as oxipng from "./png/squoosh_oxipng.js";
|
|
19
|
-
|
|
20
|
-
const oxipngInit = () => oxipng.default(
|
|
18
|
+
import oxipngWasm from "./png/squoosh_oxipng_bg.wasm.js";
|
|
19
|
+
const oxipngInit = () => oxipng.default(oxipngWasm);
|
|
21
20
|
import * as resize from "./resize/squoosh_resize.js";
|
|
22
|
-
|
|
23
|
-
const resizeInit = () => resize.default(
|
|
24
|
-
|
|
21
|
+
import resizeWasm from "./resize/squoosh_resize_bg.wasm.js";
|
|
22
|
+
const resizeInit = () => resize.default(resizeWasm);
|
|
23
|
+
import rotateWasm from "./rotate/rotate.wasm.js";
|
|
25
24
|
import ImageData from "./image_data.js";
|
|
26
25
|
global.ImageData = ImageData;
|
|
27
26
|
function resizeNameToIndex(name) {
|
|
@@ -108,7 +107,7 @@ const preprocessors = {
|
|
|
108
107
|
const degrees = numRotations * 90 % 360;
|
|
109
108
|
const sameDimensions = degrees === 0 || degrees === 180;
|
|
110
109
|
const size = width * height * 4;
|
|
111
|
-
const instance = (await WebAssembly.instantiate(
|
|
110
|
+
const instance = (await WebAssembly.instantiate(rotateWasm)).instance;
|
|
112
111
|
const { memory } = instance.exports;
|
|
113
112
|
const additionalPagesNeeded = Math.ceil(
|
|
114
113
|
(size * 2 - memory.buffer.byteLength + 8) / (64 * 1024)
|
|
@@ -136,10 +135,10 @@ const codecs = {
|
|
|
136
135
|
name: "MozJPEG",
|
|
137
136
|
extension: "jpg",
|
|
138
137
|
detectors: [/^\xFF\xD8\xFF/],
|
|
139
|
-
dec: () => instantiateEmscriptenWasm(mozDec, mozDecWasm
|
|
138
|
+
dec: () => instantiateEmscriptenWasm(mozDec, mozDecWasm),
|
|
140
139
|
enc: () => instantiateEmscriptenWasm(
|
|
141
140
|
mozEnc,
|
|
142
|
-
mozEncWasm
|
|
141
|
+
mozEncWasm
|
|
143
142
|
),
|
|
144
143
|
defaultEncoderOptions: {
|
|
145
144
|
quality: 75,
|
|
@@ -169,10 +168,10 @@ const codecs = {
|
|
|
169
168
|
name: "WebP",
|
|
170
169
|
extension: "webp",
|
|
171
170
|
detectors: [/^RIFF....WEBPVP8[LX ]/s],
|
|
172
|
-
dec: () => instantiateEmscriptenWasm(webpDec, webpDecWasm
|
|
171
|
+
dec: () => instantiateEmscriptenWasm(webpDec, webpDecWasm),
|
|
173
172
|
enc: () => instantiateEmscriptenWasm(
|
|
174
173
|
webpEnc,
|
|
175
|
-
webpEncWasm
|
|
174
|
+
webpEncWasm
|
|
176
175
|
),
|
|
177
176
|
defaultEncoderOptions: {
|
|
178
177
|
quality: 75,
|
|
@@ -214,11 +213,11 @@ const codecs = {
|
|
|
214
213
|
extension: "avif",
|
|
215
214
|
// eslint-disable-next-line no-control-regex
|
|
216
215
|
detectors: [/^\x00\x00\x00 ftypavif\x00\x00\x00\x00/],
|
|
217
|
-
dec: () => instantiateEmscriptenWasm(avifDec, avifDecWasm
|
|
216
|
+
dec: () => instantiateEmscriptenWasm(avifDec, avifDecWasm),
|
|
218
217
|
enc: async () => {
|
|
219
218
|
return instantiateEmscriptenWasm(
|
|
220
219
|
avifEnc,
|
|
221
|
-
avifEncWasm
|
|
220
|
+
avifEncWasm
|
|
222
221
|
);
|
|
223
222
|
},
|
|
224
223
|
defaultEncoderOptions: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare function pathify(path: string): string;
|
|
2
|
-
export declare function instantiateEmscriptenWasm<T extends EmscriptenWasm.Module>(factory: EmscriptenWasm.ModuleFactory<T>,
|
|
2
|
+
export declare function instantiateEmscriptenWasm<T extends EmscriptenWasm.Module>(factory: EmscriptenWasm.ModuleFactory<T>, bytes: Uint8Array): Promise<T>;
|
|
3
3
|
export declare function dirname(url: string): string;
|
|
4
4
|
/**
|
|
5
5
|
* On certain serverless hosts, our ESM bundle is transpiled to CJS before being run, which means
|
|
6
|
-
* import.meta.url is undefined, so we'll fall back to
|
|
6
|
+
* import.meta.url is undefined, so we'll fall back to __filename in those cases
|
|
7
7
|
* We should be able to remove this once https://github.com/netlify/zip-it-and-ship-it/issues/750 is fixed
|
|
8
8
|
*/
|
|
9
9
|
export declare function getModuleURL(url: string | undefined): string;
|
|
@@ -5,14 +5,12 @@ function pathify(path) {
|
|
|
5
5
|
}
|
|
6
6
|
return path;
|
|
7
7
|
}
|
|
8
|
-
function instantiateEmscriptenWasm(factory,
|
|
8
|
+
function instantiateEmscriptenWasm(factory, bytes) {
|
|
9
9
|
return factory({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return pathify(workerJS);
|
|
15
|
-
return requestPath;
|
|
10
|
+
// @ts-expect-error This is a valid Emscripten option, but the type definitions don't know about it
|
|
11
|
+
wasmBinary: bytes,
|
|
12
|
+
locateFile(file) {
|
|
13
|
+
return file;
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
}
|
|
@@ -21,7 +19,7 @@ function dirname(url) {
|
|
|
21
19
|
}
|
|
22
20
|
function getModuleURL(url) {
|
|
23
21
|
if (!url) {
|
|
24
|
-
return pathToFileURL(
|
|
22
|
+
return pathToFileURL(__filename).toString();
|
|
25
23
|
}
|
|
26
24
|
return url;
|
|
27
25
|
}
|