diff --git a/README.md b/README.md index 9d618ec..30501af 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ await esbuild outdir: 'build', bundle: true, format: 'cjs', - plugins: [ri()], + plugins: [responsiveImages()], }); ``` diff --git a/package.json b/package.json index c4e7806..8aba604 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@exact-realty/esbuild-plugin-responsive-images", - "version": "1.0.1", + "version": "1.0.2", "description": "esbuild plugin for responsive images using Sharp", "main": "dist/index.js", "module": "./dist/index.mjs", diff --git a/src/index.ts b/src/index.ts index f1ad3cb..7ffa16d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -361,9 +361,12 @@ export default (): esbuild.Plugin => ({ const pathUrl = new URL(path); - const result = await build.resolve(pathUrl.pathname, { - resolveDir, - }); + const result = await build.resolve( + decodeURIComponent(pathUrl.pathname), + { + resolveDir, + }, + ); if (result.errors.length > 0) { return { errors: result.errors };