@compiiile/compiiile 2.22.1 → 2.22.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/bin/config.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { build, dev, preview } from "astro"
2
2
  import vue from "@astrojs/vue"
3
- import { passthroughImageService } from "astro/config"
4
3
  import compiiile from "./vitePluginCompiiile/index.js"
5
4
  import mdx from "@astrojs/mdx"
6
5
  import path from "node:path"
@@ -100,7 +99,9 @@ const astroConfig = {
100
99
  enabled: false
101
100
  },
102
101
  image: {
103
- service: passthroughImageService()
102
+ service: {
103
+ entrypoint: fileURLToPath(new URL("./passthroughImageService.js", import.meta.url))
104
+ }
104
105
  },
105
106
  ...(configFromFile.astroConfig ?? {}),
106
107
  ...(argv.astroConfig ?? {})
@@ -0,0 +1,22 @@
1
+ export default {
2
+ validateOptions(options) {
3
+ if (!options.format && typeof options.src === "object") {
4
+ options.format = options.src.format
5
+ }
6
+ return options
7
+ },
8
+ getURL(options) {
9
+ return typeof options.src === "string" ? options.src : options.src.src
10
+ },
11
+ parseURL(url) {
12
+ return { src: url.searchParams.get("href") }
13
+ },
14
+ getHTMLAttributes(options) {
15
+ const { src, format, quality, widths, densities, ...attrs } = options
16
+ return { ...attrs, loading: options.loading ?? "lazy", decoding: options.decoding ?? "async" }
17
+ },
18
+ async transform(inputBuffer, transformOptions) {
19
+ return { data: inputBuffer, format: transformOptions.format }
20
+ },
21
+ propertiesToHash: ["src"]
22
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@compiiile/compiiile",
3
3
  "private": false,
4
- "version": "2.22.1",
4
+ "version": "2.22.2",
5
5
  "description": "The most convenient way to render a folder containing markdown files. Previewing and searching markdown files has never been that easy.",
6
6
  "author": "AlbanCrepel <alban.crepel@gmail.com>",
7
7
  "license": "GPL-3.0-only",