diff --git a/index.js b/index.js index 53b1195..cb068b8 100644 --- a/index.js +++ b/index.js @@ -30,6 +30,8 @@ const loop = (cb) => { }; }; +const escapeRegExp = string => string.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d'); + module.exports = (options_ = {}) => { const options = {...DEFAULTS, ...options_}; @@ -49,7 +51,6 @@ module.exports = (options_ = {}) => { ); const mapping = await getDataUriMapping([...urls], options); - const {default: escapeRegExp} = await import('escape-string-regexp'); root.walkDecls( filter, diff --git a/package.json b/package.json index 546646f..54e56e8 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "dependencies": { "asset-resolver": "^3.0.5", "debug": "^4.3.4", - "escape-string-regexp": "^5.0.0", "filesize": "^9.0.11", "svgo": "^2.8.0" },