Skip to content

Commit

Permalink
Reduce memory footprint by importing specific function from semver
Browse files Browse the repository at this point in the history
…package
  • Loading branch information
visualfanatic committed Aug 29, 2020
1 parent fedac14 commit 5d27598
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const SVGO = require('svgo');
const { getOptions } = require('loader-utils');
const { version } = require('vue');
const { major } = require('semver')
const semverMajor = require('semver/functions/major')

module.exports = async function (svg) {
const callback = this.async();
Expand All @@ -20,7 +20,7 @@ module.exports = async function (svg) {
}
}

if (major(version) === 2) {
if (semverMajor(version) === 2) {
svg = svg.replace('<svg', '<svg v-on="$listeners"');
}

Expand Down

0 comments on commit 5d27598

Please sign in to comment.