Skip to content

Commit 5d27598

Browse files
committed
Reduce memory footprint by importing specific function from semver package
1 parent fedac14 commit 5d27598

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const SVGO = require('svgo');
22
const { getOptions } = require('loader-utils');
33
const { version } = require('vue');
4-
const { major } = require('semver')
4+
const semverMajor = require('semver/functions/major')
55

66
module.exports = async function (svg) {
77
const callback = this.async();
@@ -20,7 +20,7 @@ module.exports = async function (svg) {
2020
}
2121
}
2222

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

0 commit comments

Comments
 (0)