Fix nix build
Apparently tabs are bad.
This commit is contained in:
parent
0d6a6fa797
commit
9cbce4ff14
1 changed files with 21 additions and 21 deletions
42
default.nix
42
default.nix
|
|
@ -19,34 +19,34 @@ pkgs.buildGoModule rec {
|
|||
];
|
||||
|
||||
preBuild = ''
|
||||
# Compile SCSS
|
||||
SASS_SRC_DIR="./scss"
|
||||
CSS_OUTPUT_DIR="./html/static/css/"
|
||||
# Compile SCSS
|
||||
SASS_SRC_DIR="./scss"
|
||||
CSS_OUTPUT_DIR="./static/gen/css/"
|
||||
|
||||
mkdir -p "$CSS_OUTPUT_DIR"
|
||||
mkdir -p "$CSS_OUTPUT_DIR"
|
||||
|
||||
echo "Compiling $SASS_SRC_DIR/custom.scss to $CSS_OUTPUT_DIR/bootstrap.css..."
|
||||
sass --style=compressed --trace "$SASS_SRC_DIR/custom.scss":"$CSS_OUTPUT_DIR/bootstrap.css"
|
||||
echo "Compiling $SASS_SRC_DIR/style.scss to $CSS_OUTPUT_DIR/bootstrap.css..."
|
||||
sass --style=compressed --trace "$SASS_SRC_DIR/style.scss":"$CSS_OUTPUT_DIR/bootstrap.css"
|
||||
|
||||
# Bundle TypeScript
|
||||
JS_OUTPUT_DIR="./html/static/gen/js/"
|
||||
mkdir -p "$JS_OUTPUT_DIR"
|
||||
# Bundle TypeScript
|
||||
JS_OUTPUT_DIR="./static/gen/js/"
|
||||
mkdir -p "$JS_OUTPUT_DIR"
|
||||
|
||||
echo "Bundling TypeScript..."
|
||||
esbuild ts/main.ts --bundle --minify --outfile="$JS_OUTPUT_DIR/bundle.js"
|
||||
echo "Bundling TypeScript..."
|
||||
esbuild ts/main.ts --bundle --minify --outfile="$JS_OUTPUT_DIR/bundle.js"
|
||||
|
||||
# Generate hash and rename bundle
|
||||
BUNDLE_HASH=$(sha256sum "$JS_OUTPUT_DIR/bundle.js" | cut -c1-12)
|
||||
mv "$JS_OUTPUT_DIR/bundle.js" "$JS_OUTPUT_DIR/bundle.$BUNDLE_HASH.js"
|
||||
# Generate hash and rename bundle
|
||||
BUNDLE_HASH=$(sha256sum "$JS_OUTPUT_DIR/bundle.js" | cut -c1-12)
|
||||
mv "$JS_OUTPUT_DIR/bundle.js" "$JS_OUTPUT_DIR/bundle.$BUNDLE_HASH.js"
|
||||
|
||||
# Generate gen.go with bundle path
|
||||
cat > gen.go <<EOF
|
||||
package main
|
||||
# Generate gen.go with bundle path
|
||||
cat > gen.go <<EOF
|
||||
package main
|
||||
|
||||
// Generated by Nix build - do not edit manually
|
||||
const JsBundlePath = "/static/js/bundel.$BUNDLE_HASH.js"
|
||||
EOF
|
||||
// Generated by Nix build - do not edit manually
|
||||
const JsBundlePath = "/static/js/bundel.$BUNDLE_HASH.js"
|
||||
EOF
|
||||
|
||||
echo "Generated JS bundle with hash: $BUNDLE_HASH"
|
||||
echo "Generated JS bundle with hash: $BUNDLE_HASH"
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue