outaTiME/grunt-replace

How can I escape forward slashes in patterns?

Bencsi opened this issue · 4 comments

The pattern 'match' and 'replacement' contains forward slashes (/), the task throw an error.
Here is a piece of my code:

font: {
  options: {
    patterns: [
      {
        match: '(../fonts/',
        replacement: '../font/'
      }
    ],
    usePrefix: false
  },
  files: [
    {expand: true, flatten: true, src: ['web/css/vendor.css'], dest: ''}
  ]
}

Hi pal, can you sendme the error ??? you coud try the following:

font: {
  options: {
    patterns: [
      {
        match: /\(\.\.\/fonts\//g,
        replacement: '../font/'
      }
    ]
  },
  files: [
    {expand: true, flatten: true, src: ['web/css/vendor.css'], dest: ''}
  ]
}

Im try your code and i get exception too ...
I will realase new version soon ... the issue come from https://github.com/outaTiME/applause library ...

thks !!

heeey, im just release the new grunt-replace version the 0.8.0 check it out plz ...

Works fine, thx.