Skip to content

Configuration

Noah Baldwin edited this page Nov 28, 2025 · 2 revisions

OXVG can be configured by using a configuration file.

oxvg will look in one of two places for a configuration

  • ./oxvgrc.json within your current-working-directory; or
  • oxvg/config.json within etcetera's base strategy (e.g. ~/.config/oxvg/config.json).

The available options for configuration are detailed in the Config docs.

Default options

To output your current config (or default) you can run the following.

oxvg optimise --config
{
  "optimise": {
    "jobs": {
      "removeDoctype": true,
      "removeXMLProcInst": true,
      "removeComments": {},
      "removeDeprecatedAttrs": {
        "removeUnsafe": false
      },
      "removeMetadata": true,
      "removeEditorsNSData": {
        "additionalNamespaces": null
      },
      "cleanupAttrs": {
        "newlines": true,
        "trim": true,
        "spaces": true
      },
      "mergeStyles": true,
      "inlineStyles": {
        "onlyMatchedOnce": true,
        "removeMatchedSelectors": true,
        "useMqs": [
          "",
          "screen"
        ],
        "usePseudos": [
          ""
        ]
      },
      "minifyStyles": {
        "removeUnused": true
      },
      "cleanupIds": {
        "remove": true,
        "minify": true,
        "preserve": null,
        "preservePrefixes": null,
        "force": false
      },
      "removeUselessDefs": true,
      "cleanupNumericValues": {
        "floatPrecision": 3,
        "leadingZero": true,
        "defaultPx": true,
        "convertToPx": true
      },
      "convertColors": {
        "method": null
      },
      "removeUnknownsAndDefaults": {
        "unknownContent": true,
        "unknownAttrs": true,
        "defaultAttrs": true,
        "defaultMarkupDeclarations": true,
        "uselessOverrides": true,
        "keepDataAttrs": true,
        "keepAriaAttrs": true,
        "keepRoleAttr": false
      },
      "removeNonInheritableGroupAttrs": true,
      "removeUselessStrokeAndFill": {
        "stroke": true,
        "fill": true,
        "removeNone": false
      },
      "cleanupEnableBackground": true,
      "removeHiddenElems": {
        "isHidden": null,
        "displayNone": null,
        "opacityZero": null,
        "circleRZero": null,
        "ellipseRxZero": null,
        "ellipseRyZero": null,
        "rectWidthZero": null,
        "rectHeightZero": null,
        "patternWidthZero": null,
        "patternHeightZero": null,
        "imageWidthZero": null,
        "imageHeightZero": null,
        "pathEmptyD": null,
        "polylineEmptyPoints": null,
        "polygonEmptyPoints": null
      },
      "removeEmptyText": {
        "text": null,
        "tspan": null,
        "tref": null
      },
      "convertShapeToPath": {
        "convertArcs": false,
        "floatPrecision": null
      },
      "convertEllipseToCircle": true,
      "moveElemsAttrsToGroup": true,
      "moveGroupAttrsToElems": true,
      "collapseGroups": true,
      "applyTransforms": {
        "transformPrecision": null,
        "applyTransformsStroked": false
      },
      "convertPathData": {
        "removeUseless": true,
        "smartArcRounding": true,
        "straightCurves": true,
        "convertToQ": true,
        "lineShorthands": true,
        "collapseRepeated": true,
        "curveSmoothShorthands": true,
        "convertToZ": true,
        "forceAbsolutePath": false,
        "negativeExtraSpace": true,
        "makeArcs": {
          "threshold": 2.5,
          "tolerance": 0.5
        },
        "floatPrecision": null,
        "utilizeAbsolute": true
      },
      "convertTransform": {
        "convertToShorts": true,
        "degPrecision": null,
        "floatPrecision": 3,
        "transformPrecision": 5,
        "matrixToTransform": true,
        "shortRotate": true,
        "removeUseless": true,
        "collapseIntoOne": true
      },
      "removeEmptyAttrs": true,
      "removeEmptyContainers": true,
      "removeUnusedNS": true,
      "mergePaths": {
        "force": false
      },
      "sortAttrs": {
        "order": null,
        "xmlnsOrder": null
      },
      "sortDefsChildren": true,
      "removeDesc": {
        "removeAny": false
      }
    }
  },
  "lint": {
    "noUnknownAttributes": "Error"
  }
}

Clone this wiki locally