From 0829d5a02e36d762f6d4ceb3eac5eaacbf0369f2 Mon Sep 17 00:00:00 2001 From: Alexey Romanov <104450112+alexeyr-ci@users.noreply.github.com> Date: Mon, 25 Nov 2024 04:40:41 +0300 Subject: [PATCH] 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. --- docs/v8_upgrade.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/v8_upgrade.md b/docs/v8_upgrade.md index 20ee5739..529cbbb5 100644 --- a/docs/v8_upgrade.md +++ b/docs/v8_upgrade.md @@ -21,9 +21,7 @@ If your host might differ, between various environments for example, you will ei - Ensure the assets are specifically rebuilt for each environment (Heroku pipeline promote feature for example does not do that by default). - Make sure the assets are compiled with `SHAKAPACKER_ASSET_HOST=''` ENV variable to avoid hardcording URLs in packs output. -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`. - -Make sure the assets are compiled with `SHAKAPACKER_ASSET_HOST=''` ENV variable to avoid hardcoding URLs in packs output. +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`. 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). @@ -102,10 +100,10 @@ namespace :assets do raise if File.exist?("package.json") && !(system "npm ci") # yarn v1.x (classic) - raise if File.exist?("package.json") && !(system "yarn install --immutable") + raise if File.exist?("package.json") && !(system "yarn install --frozen-lockfile") # yarn v2+ (berry) - raise if File.exist?("package.json") && !(system "yarn install --frozen-lockfile") + raise if File.exist?("package.json") && !(system "yarn install --immutable") # bun v1+ raise if File.exist?("package.json") && !(system "bun install --frozen-lockfile")