Skip to content

Commit a4d6b43

Browse files
committed
Revert "feat: rename loader.url into loader.resourcePath"
This reverts commit d8d846f.
1 parent fc6e402 commit a4d6b43

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

packages/core/src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const pluginImage = (
121121

122122
let loader: string | undefined;
123123
if (typeof options.loader === 'function') {
124-
loader = options.loader.resourcePath;
124+
loader = options.loader.url;
125125
if (!loader) throw new UnableResolveImageLoaderError();
126126
} else {
127127
loader = options.loader;

packages/core/src/shared/image-loader.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { fileURLToPath } from 'node:url';
21
import { joinURL, parseURL, stringifyParsedURL } from 'ufo';
32
import { DEFAULT_IPX_BASENAME } from './constants';
43
import type { ImageLoader, ImageLoaderArgs } from './types/image';
@@ -36,6 +35,6 @@ export const ipxImageLoader: ImageLoader = ({ src, width, quality }) => {
3635
return stringifyParsedURL(parsedSrc);
3736
};
3837

39-
ipxImageLoader.resourcePath = fileURLToPath(import.meta.url);
38+
ipxImageLoader.url = import.meta.url;
4039

4140
export default ipxImageLoader;

packages/core/src/shared/types/image.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface ImageLoaderArgs
2222

2323
export interface ImageLoader {
2424
(args: ImageLoaderArgs): string;
25-
resourcePath?: string;
25+
url?: string;
2626
}
2727

2828
/**

0 commit comments

Comments
 (0)