Skip to content

Commit 0829d5a

Browse files
authored
Fix install commands for different yarn versions (#525)
The install command given for Yarn Classic only works for Yarn Berry. The command given for Yarn Berry works, but only due to backward compatibility.
1 parent f829152 commit 0829d5a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

docs/v8_upgrade.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ If your host might differ, between various environments for example, you will ei
2121
- Ensure the assets are specifically rebuilt for each environment (Heroku pipeline promote feature for example does not do that by default).
2222
- Make sure the assets are compiled with `SHAKAPACKER_ASSET_HOST=''` ENV variable to avoid hardcording URLs in packs output.
2323

24-
Second option has got a certain gotcha - dynamic imports and static asset references (like image paths in CSS) will end up without host reference and the app will try and fetch them from your app host rather than defined `config.asset_host`.
25-
26-
Make sure the assets are compiled with `SHAKAPACKER_ASSET_HOST=''` ENV variable to avoid hardcoding URLs in packs output.
24+
The second option has got a certain gotcha - dynamic imports and static asset references (like image paths in CSS) will end up without a host reference and the app will try and fetch them from your app host rather than defined `config.asset_host`.
2725

2826
To get around that, you can use dynamic override as outlined by [Webpack documentation](https://webpack.js.org/guides/asset-modules/#on-the-fly-override).
2927

@@ -102,10 +100,10 @@ namespace :assets do
102100
raise if File.exist?("package.json") && !(system "npm ci")
103101

104102
# yarn v1.x (classic)
105-
raise if File.exist?("package.json") && !(system "yarn install --immutable")
103+
raise if File.exist?("package.json") && !(system "yarn install --frozen-lockfile")
106104

107105
# yarn v2+ (berry)
108-
raise if File.exist?("package.json") && !(system "yarn install --frozen-lockfile")
106+
raise if File.exist?("package.json") && !(system "yarn install --immutable")
109107

110108
# bun v1+
111109
raise if File.exist?("package.json") && !(system "bun install --frozen-lockfile")

0 commit comments

Comments
 (0)