Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

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

Open
snsttr opened this issue Aug 2, 2019 · 1 comment
Open

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

snsttr opened this issue Aug 2, 2019 · 1 comment

Comments

@snsttr
Copy link

snsttr commented Aug 2, 2019

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.

@snsttr snsttr changed the title wrong generation of path to js-files in rev-manifest on windows wrong generation of path for js-files in rev-manifest on windows Aug 2, 2019
@jamesmacwhite
Copy link

jamesmacwhite commented Aug 5, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants