omacranger / fontawesome-subset

Creates subsets of FontAwesome fonts for optimized use on the web.
GNU General Public License v3.0
66 stars 15 forks source link

Invalid regular expression flags #6

Closed beckbailey closed 3 years ago

beckbailey commented 3 years ago

**Using Gulp. I'm possibly doing something wrong.

From my Gulpfile**

const fontawesomeSubset = require('fontawesome-subset');

function fa() { fontawesomeSubset(['home'], './web/dist/webfonts/fasubset'); } My commands

c:\ gulp fa

I get the following error:

c:\ node_modules\fontawesome-subset\dist\index.js:84 var svgContentsNew = svgFile.replace(new RegExp("(<glyph glyph-name=\"(" + glyphsToRemove.join("|") + ")\".*?\/>)", "gms"), "").replace(/>\s+</gms, "><"); ^

SyntaxError: Invalid regular expression flags at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:607:28) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object. (c:\gulpfile.js:12:29)

omacranger commented 3 years ago

What version of Node do you have installed? I think I've seen this before on versions < 10.

beckbailey commented 3 years ago

That's probably it. Thanks.