From 685ebedc2db530473c535a0ba20c26280c47cb39 Mon Sep 17 00:00:00 2001 From: KorbsStudio Date: Mon, 23 Jan 2023 03:55:53 -0500 Subject: [PATCH] Move prepare script to build folder --- build/prepare-production.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 build/prepare-production.js diff --git a/build/prepare-production.js b/build/prepare-production.js new file mode 100644 index 0000000..8f9db14 --- /dev/null +++ b/build/prepare-production.js @@ -0,0 +1,12 @@ +// What's all this? +// When preparing your app for production, Astro needs to be built first. +// Astro builds with the index file pointing to the wrong path for CSS, as it's using "/assets/" instead of "./assets/", that one dot is important. +// This file will quickly fix that for you, also it's part of the `yarn build` command so you don't need to worry about it each time you build. +var replace = require("replace"); +replace({ + regex: "/assets/", + replacement: "./assets/", + paths: ['./app/index.html'], + recursive: true, + silent: true, +}); \ No newline at end of file