Skip to content

Commit b29d6a6

Browse files
committed
[Deps] update resolve, svgo
1 parent b839b94 commit b29d6a6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
"@babel/helper-plugin-utils": "^7.0.0",
5252
"@babel/parser": "^7.0.0",
5353
"lodash.isplainobject": "^4.0.6",
54-
"resolve": "^1.20.0",
55-
"svgo": "^2.0.3"
54+
"resolve": "^2.0.0-next.4",
55+
"svgo": "^2.8.0"
5656
},
5757
"engines": {
5858
"node": ">=10.13"

src/index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { extname, dirname, parse as parseFilename } from 'path';
22
import { readFileSync } from 'fs';
33
import { parse } from '@babel/parser';
44
import { declare } from '@babel/helper-plugin-utils';
5-
import resolve from 'resolve';
5+
import resolve from 'resolve/sync';
66

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

0 commit comments

Comments
 (0)