From 421f11143d7ea0276ffbabf7fb786f4679effa34 Mon Sep 17 00:00:00 2001 From: Emi Dunn-Rankin Date: Thu, 26 Oct 2023 21:39:42 +0000 Subject: [PATCH] Build wardrobe-2020 JS during dev container setup Oh yeah right, let's `yarn install` and build as part of the `post-create.sh` script! I didn't have a command to do a one-time dev build of the assets yet (just one-time prod, or dev with reloading), so I added `yarn build:dev`! --- .devcontainer/post-create.sh | 6 ++++++ package.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index d27e4297..1aff43ad 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -11,3 +11,9 @@ bundle install # Set up the databases: create the schema, and load in some default data. bin/rails db:schema:load db:seed + +# Install the app's JS dependencies. +yarn install + +# Run a first-time build of the app's JS, in development mode. +yarn build:dev diff --git a/package.json b/package.json index 98488824..f341db16 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ }, "scripts": { "build": "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 --watch --public-path=/dev-assets" + "build:dev": "yarn build --public-path=/dev-assets", + "dev": "yarn build:dev --watch" } }