Skip to content

Commit

Permalink
[Deps] update resolve, svgo
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 17, 2023
1 parent b839b94 commit b29d6a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -51,8 +51,8 @@
"@babel/helper-plugin-utils": "^7.0.0",
"@babel/parser": "^7.0.0",
"lodash.isplainobject": "^4.0.6",
"resolve": "^1.20.0",
"svgo": "^2.0.3"
"resolve": "^2.0.0-next.4",
"svgo": "^2.8.0"
},
"engines": {
"node": ">=10.13"
Expand Down
7 changes: 5 additions & 2 deletions src/index.js
Expand Up @@ -2,7 +2,7 @@ import { extname, dirname, parse as parseFilename } from 'path';
import { readFileSync } from 'fs';
import { parse } from '@babel/parser';
import { declare } from '@babel/helper-plugin-utils';
import resolve from 'resolve';
import resolve from 'resolve/sync';

import optimize from './optimize';
import escapeBraces from './escapeBraces';
Expand Down Expand Up @@ -61,7 +61,10 @@ export default declare(({
// This plugin only applies for SVGs:
if (extname(importPath) === '.svg') {
const iconPath = filename || providedFilename;
const svgPath = resolve.sync(importPath, { basedir: dirname(iconPath) });
const svgPath = resolve(importPath, {
basedir: dirname(iconPath),
preserveSymlinks: true,
});
if (caseSensitive && !fileExistsWithCaseSync(svgPath)) {
throw new Error(`File path didn't match case of file on disk: ${svgPath}`);
}
Expand Down

0 comments on commit b29d6a6

Please sign in to comment.