Replace the two previous line with this:

```
contents = contents.replace( /"([^"]*)?\.(js|css)"/g, "\"$1.min.$2\"" );
```