Closed tomdracz closed 6 months ago
The changes primarily involve reverting the behavior of Webpacker to exclude CDN URLs in the manifest.json
paths, ensuring that asset paths are local. This affects the publicPath
configuration, testing, and documentation to reflect the updated handling of asset paths, addressing issues with asset cleaning tasks.
File | Change Summary |
---|---|
CHANGELOG.md |
Removed CDN URLs from manifest.json paths, reverting to pre-Webpacker v6 behavior. |
package/environments/base.js |
Updated publicPath in getPlugins function to use config.publicPathWithoutCDN . |
test/package/config.test.js |
Added tests to verify the public path without CDN is unaffected by asset host. |
docs/v8_upgrade.md |
Added info on handling CDN host inclusion in the manifest output. |
Objective | Addressed | Explanation |
---|---|---|
Ensure assets:clean / webpacker:clean task does not delete the latest version of files when asset_host is set (#151) |
✅ | |
Revert to manifest behavior prior to Webpacker v6 to exclude CDN URLs (#151) | ✅ | |
Update documentation to reflect changes in asset path handling (#151) | ✅ | |
Add tests to ensure public path without CDN is not impacted by asset host (#151) | ✅ |
In code we trust, our paths now clear, No CDN woes, no assets disappear. With tests in place and docs aligned, Our Webpacker woes are left behind. 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary
Fixes #151
Asset manifests path used to be output without CDN as per https://github.com/rails/webpacker/pull/1974
But then aborted Webpacker v6 added the CDN back for reasons unknown https://github.com/rails/webpacker/pull/2802
This is causing issues with the clean tasks and requires other workarounds as outlined in https://github.com/shakacode/shakapacker/blob/main/docs/troubleshooting.md#wrong-cdn-src-from-javascript_pack_tag
The PR reverts this behaviour so the assets are once again listed in the manifest output without CDN
Pull Request checklist
Summary by CodeRabbit
Bug Fixes
Documentation
Tests