vigetlabs / blendid

A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wrong generation of path for js-files in rev-manifest on windows

snsttr opened this issue · comments

On my windows system all js-ressources in the rev-manifest.json have backslashes in their file pathes. This makes it impossible for the craft 3 plugin "craft-asset-rev" to find the correct assertion, since it expects the path with slashes.

Example:
blendid generates
"javascripts\\app.js": "javascripts\\app-040d86f5c824dfce4156.js",
craft-asset-rev would work with
"javascripts/app.js": "javascripts/app-040d86f5c824dfce4156.js",

Possible solution:
The file path is being generated in gulpfile.js/lib/webpackManifest.js by using path.join(...) which generates backslashes for file pathes on windows systems (for original filename and filename with hash). You could just replace backslashes with slashes here.

Can also confirm this on Windows 10. Fortunately, only my development environment is Windows, so I don't need to use rev, our staging/production as well as CI are all Linux, so the webpack production build task outputs the JS rev-manifest.json paths correctly in these environments. Not sure if this has been happening for sometime, until I only noticed when testing the build task locally for some additional task work.

As a possible workaround you can use WSL which would use Linux binaries.