Skip to content

Commit

Permalink
Add missing decodeURIComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat committed May 14, 2022
1 parent a8b28d3 commit 2810880
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ await esbuild
outdir: 'build',
bundle: true,
format: 'cjs',
plugins: [ri()],
plugins: [responsiveImages()],
});
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down

0 comments on commit 2810880

Please sign in to comment.