Oops, it wasn't that it wasn't finding the file, it was that the first line failed.
25 lines
518 B
Bash
Executable file
25 lines
518 B
Bash
Executable file
#!/bin/bash
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
set -o xtrace
|
|
|
|
yarn "build:targets"
|
|
|
|
PROD='dist/prod'
|
|
if [[ -d "$PROD" ]]; then
|
|
rm -r "$PROD"
|
|
fi
|
|
mkdir -p "$PROD"
|
|
|
|
echo 'Rendering webpage...'
|
|
node -e 'import("./dist/server/entry-server.js").then(({render}) => console.log(render().html))' > "$PROD"/index.html
|
|
|
|
echo "Preparing $PROD..."
|
|
# Copy used assets
|
|
cp -r dist/client/assets "$PROD"/
|
|
cp public/* "$PROD"/
|
|
# Not needed: Pre-rendered
|
|
rm "$PROD"/assets/*.js
|
|
# Not needed: Inlined
|
|
rm "$PROD"/assets/*.css
|