Skip to content

Commit

Permalink
Strip CDN from manifest output
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdracz committed May 10, 2024
1 parent 1a89919 commit 18537ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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
})
]

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

0 comments on commit 18537ef

Please sign in to comment.