From 5556873eaa4ca1e0a77267da295c61ddd656dd53 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 22 Aug 2023 16:15:21 -0700 Subject: [PATCH] Fix asset path in JS modules in development Oh right, since we've told Rails that in development the assets path is `/dev-assets`, but the JS scripts don't know that, they're still sending requests to `/assets/thing.svg` or whatever, which is returning the prebuilt production asset if present, or nothing if not. Fixed! --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d1b7578c..b1e313ee 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,6 @@ "scripts": { "build": "yarn build:base --minify", "build:base": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=/assets --asset-names=[name]-[hash].digested --loader:.js=jsx --loader:.png=file --loader:.svg=file --loader:.min.js=text", - "dev": "yarn build:base --watch" + "dev": "yarn build:base --watch --public-path=/dev-assets" } }