Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip CDN from manifest output #473

Merged
merged 7 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ _next_ branch is for v8 changes
## [Unreleased]
Changes since the last non-beta release.

### Breaking changes
- Removes CDN url from the manifest.json paths. [PR 473](https://github.com/shakacode/shakapacker/pull/473) by [tomdracz](https://github.com/tomdracz).

This returns to the Webpacker behaviour prior to the aborted Webpacker v6.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider simplifying "prior to" to "before" for clarity.

- This returns to the Webpacker behaviour prior to the aborted Webpacker v6.
+ This returns to the Webpacker behaviour before the aborted Webpacker v6.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
This returns to the Webpacker behaviour prior to the aborted Webpacker v6.
This returns to the Webpacker behaviour before the aborted Webpacker v6.


### Fixed

- Fixes incorrect removal of files in the assets:clean task [PR 474](https://github.com/shakacode/shakapacker/pull/474) by [tomdracz](https://github.com/tomdracz).
Expand Down
2 changes: 1 addition & 1 deletion package/environments/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const getPlugins = () => {
writeToDisk: true,
output: config.manifestPath,
entrypointsUseAssets: true,
publicPath: true
publicPath: config.publicPathWithoutCDN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to document who this affects and the migration instructions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I'll get something added to the migration guide

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done?

})
]

Expand Down
7 changes: 7 additions & 0 deletions test/package/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ describe("Config", () => {
expect(config.publicPath).toBe("http://foo.com/packs/")
})

test("public path without CDN is not affected by the asset host", () => {
process.env.RAILS_ENV = "development"
process.env.SHAKAPACKER_ASSET_HOST = "http://foo.com/"
const config = require("../../package/config")
expect(config.publicPathWithoutCDN).toBe("/packs/")
})

test("should return additional paths as listed in app config, with resolved paths", () => {
const config = require("../../package/config")

Expand Down
Loading