Skip to content

Merge Paths Default

Merge multiple paths into one.

Usage

js
module.exports = {
  plugins: ["mergePaths"],
};
module.exports = {
  plugins: ["mergePaths"],
};

Parameters

floatPrecisionNumber of decimal places to round to, using conventional rounding rules.
noSpaceAfterFlagsIf to omit spaces after flags. Flags are values that can only be 0 or 1 and are used by some path commands, namely A and a.
Usage example
js
module.exports = {
  plugins: [
    {
      name: "mergePaths",
      params: {
        force: false,
        floatPrecision: null,
        noSpaceAfterFlags: false
      }
    }
  ]
}
module.exports = {
  plugins: [
    {
      name: "mergePaths",
      params: {
        force: false,
        floatPrecision: null,
        noSpaceAfterFlags: false
      }
    }
  ]
}

Demo

Implementation

https://github.com/svg/svgo/blob/main/plugins/mergePaths.js