wpfpizicai / gulp-md5-plus

md5 plugin for gulp
58 stars 38 forks source link

Issue with file.path #24

Open khsmaxim opened 7 years ago

khsmaxim commented 7 years ago

Hi,

I got following issue:

[13:34:49] Finished 'watch:sass' after 46 ms events.js:160 throw er; // Unhandled 'error' event ^ Error: ENOENT: no such file or directory, open 'D:...\dist\sources.js?7ec9346c08' at Error (native)

And it's solved only after remove the line 43: file.path = path.join(dir, md5_filename);

Another issue - sometimes I got following situation: <link rel="stylesheet" href="/app/sources.css?525b3c5c4c?525b3c5c4c?525b3c5c4c?525b3c5c4c">

I solved it by changing line: 38: var result = fs.readFileSync(ilist,'utf8').replace(new RegExp(escapeRegExp(sub_namepath + filename)+'(.*?)((?=\")|(?=\'))', "g"), sub_namepath + md5_filename); i.e. added to regular expression additional keys '(.*?)((?=\")|(?=\'))'

you can check it on /sources\.css+(.*?)((?=\")|(?=\'))/g with content like

<link rel="stylesheet" href="/app/plugins/angularjs-slider-master/dist/rzslider.min.css">
<link rel="stylesheet" href="/app/plugins/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/app/plugins/FlipClock-master/compiled/flipclock.css">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="/app/sources.css?525b3c5c4c?525b3c5c4c?525b3c5c4c?525b3c5c4c' sdcd="d"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<title>Title</title>
<base href="/app">

This can help improve the module. Thanks, Max

khsmaxim commented 7 years ago

http://www.regextester.com/