@svgr/babel-preset
Advanced tools
Comparing version 6.5.1 to 7.0.0
@@ -12,13 +12,2 @@ 'use strict'; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var addJSXAttribute__default = /*#__PURE__*/_interopDefaultLegacy(addJSXAttribute); | ||
var removeJSXAttribute__default = /*#__PURE__*/_interopDefaultLegacy(removeJSXAttribute); | ||
var removeJSXEmptyExpression__default = /*#__PURE__*/_interopDefaultLegacy(removeJSXEmptyExpression); | ||
var replaceJSXAttributeValue__default = /*#__PURE__*/_interopDefaultLegacy(replaceJSXAttributeValue); | ||
var svgDynamicTitle__default = /*#__PURE__*/_interopDefaultLegacy(svgDynamicTitle); | ||
var svgEmDimensions__default = /*#__PURE__*/_interopDefaultLegacy(svgEmDimensions); | ||
var transformReactNativeSVG__default = /*#__PURE__*/_interopDefaultLegacy(transformReactNativeSVG); | ||
var transformSvgComponent__default = /*#__PURE__*/_interopDefaultLegacy(transformSvgComponent); | ||
const getAttributeValue = (value) => { | ||
@@ -90,6 +79,6 @@ const literal = typeof value === "string" && value.startsWith("{") && value.endsWith("}"); | ||
const plugins = [ | ||
[transformSvgComponent__default["default"], opts], | ||
[transformSvgComponent, opts], | ||
...opts.icon !== false && opts.dimensions ? [ | ||
[ | ||
svgEmDimensions__default["default"], | ||
svgEmDimensions, | ||
opts.icon !== true ? { width: opts.icon, height: opts.icon } : opts.native ? { width: 24, height: 24 } : {} | ||
@@ -99,14 +88,14 @@ ] | ||
[ | ||
removeJSXAttribute__default["default"], | ||
removeJSXAttribute, | ||
{ elements: ["svg", "Svg"], attributes: toRemoveAttributes } | ||
], | ||
[ | ||
addJSXAttribute__default["default"], | ||
addJSXAttribute, | ||
{ elements: ["svg", "Svg"], attributes: toAddAttributes } | ||
], | ||
removeJSXEmptyExpression__default["default"] | ||
removeJSXEmptyExpression | ||
]; | ||
if (opts.replaceAttrValues) { | ||
plugins.push([ | ||
replaceJSXAttributeValue__default["default"], | ||
replaceJSXAttributeValue, | ||
{ values: replaceMapToValues(opts.replaceAttrValues) } | ||
@@ -116,9 +105,9 @@ ]); | ||
if (opts.titleProp) { | ||
plugins.push(svgDynamicTitle__default["default"]); | ||
plugins.push(svgDynamicTitle); | ||
} | ||
if (opts.descProp) { | ||
plugins.push([svgDynamicTitle__default["default"], { tag: "desc" }, "desc"]); | ||
plugins.push([svgDynamicTitle, { tag: "desc" }, "desc"]); | ||
} | ||
if (opts.native) { | ||
plugins.push(transformReactNativeSVG__default["default"]); | ||
plugins.push(transformReactNativeSVG); | ||
} | ||
@@ -125,0 +114,0 @@ return { plugins }; |
{ | ||
"name": "@svgr/babel-preset", | ||
"description": "SVGR preset that apply transformations from config", | ||
"version": "6.5.1", | ||
"version": "7.0.0", | ||
"main": "./dist/index.js", | ||
@@ -24,3 +24,3 @@ "types": "./dist/index.d.ts", | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=14" | ||
}, | ||
@@ -34,10 +34,10 @@ "homepage": "https://react-svgr.com", | ||
"dependencies": { | ||
"@svgr/babel-plugin-add-jsx-attribute": "^6.5.1", | ||
"@svgr/babel-plugin-remove-jsx-attribute": "*", | ||
"@svgr/babel-plugin-remove-jsx-empty-expression": "*", | ||
"@svgr/babel-plugin-replace-jsx-attribute-value": "^6.5.1", | ||
"@svgr/babel-plugin-svg-dynamic-title": "^6.5.1", | ||
"@svgr/babel-plugin-svg-em-dimensions": "^6.5.1", | ||
"@svgr/babel-plugin-transform-react-native-svg": "^6.5.1", | ||
"@svgr/babel-plugin-transform-svg-component": "^6.5.1" | ||
"@svgr/babel-plugin-add-jsx-attribute": "^7.0.0", | ||
"@svgr/babel-plugin-remove-jsx-attribute": "^7.0.0", | ||
"@svgr/babel-plugin-remove-jsx-empty-expression": "^7.0.0", | ||
"@svgr/babel-plugin-replace-jsx-attribute-value": "^7.0.0", | ||
"@svgr/babel-plugin-svg-dynamic-title": "^7.0.0", | ||
"@svgr/babel-plugin-svg-em-dimensions": "^7.0.0", | ||
"@svgr/babel-plugin-transform-react-native-svg": "^7.0.0", | ||
"@svgr/babel-plugin-transform-svg-component": "^7.0.0" | ||
}, | ||
@@ -49,6 +49,6 @@ "peerDependencies": { | ||
"reset": "rm -rf dist", | ||
"build": "rollup -c ../../build/rollup.config.js", | ||
"build": "rollup -c ../../build/rollup.config.mjs", | ||
"prepublishOnly": "npm run reset && npm run build" | ||
}, | ||
"gitHead": "d5efedd372999692f84d30072e502b5a6b8fe734" | ||
"gitHead": "3b04a923ae6e0945a9401ad7da7efe26204c8390" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 2 instances in 1 package
0
14151
132
+ Added@svgr/babel-plugin-add-jsx-attribute@7.0.0(transitive)
+ Added@svgr/babel-plugin-remove-jsx-attribute@7.0.0(transitive)
+ Added@svgr/babel-plugin-remove-jsx-empty-expression@7.0.0(transitive)
+ Added@svgr/babel-plugin-replace-jsx-attribute-value@7.0.0(transitive)
+ Added@svgr/babel-plugin-svg-dynamic-title@7.0.0(transitive)
+ Added@svgr/babel-plugin-svg-em-dimensions@7.0.0(transitive)
+ Added@svgr/babel-plugin-transform-react-native-svg@7.0.0(transitive)
+ Added@svgr/babel-plugin-transform-svg-component@7.0.0(transitive)
- Removed@svgr/babel-plugin-add-jsx-attribute@6.5.1(transitive)
- Removed@svgr/babel-plugin-remove-jsx-attribute@8.0.0(transitive)
- Removed@svgr/babel-plugin-remove-jsx-empty-expression@8.0.0(transitive)
- Removed@svgr/babel-plugin-replace-jsx-attribute-value@6.5.1(transitive)
- Removed@svgr/babel-plugin-svg-dynamic-title@6.5.1(transitive)
- Removed@svgr/babel-plugin-svg-em-dimensions@6.5.1(transitive)
- Removed@svgr/babel-plugin-transform-react-native-svg@6.5.1(transitive)
- Removed@svgr/babel-plugin-transform-svg-component@6.5.1(transitive)
Updated@svgr/babel-plugin-remove-jsx-empty-expression@^7.0.0
Updated@svgr/babel-plugin-replace-jsx-attribute-value@^7.0.0