Fix flake to build with vite
This commit is contained in:
parent
7e7d2fc86b
commit
7ee840c28a
12
flake.nix
12
flake.nix
@ -32,6 +32,7 @@
|
|||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
openssl
|
openssl
|
||||||
sqlite
|
sqlite
|
||||||
|
nodejs_20
|
||||||
];
|
];
|
||||||
in {
|
in {
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
@ -53,10 +54,17 @@
|
|||||||
|
|
||||||
inherit nativeBuildInputs buildInputs;
|
inherit nativeBuildInputs buildInputs;
|
||||||
|
|
||||||
# Copy static files to the output
|
# Build the Vite assets and copy them to the output
|
||||||
|
preInstall = ''
|
||||||
|
cd static
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
cd ..
|
||||||
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
cp -r static $out
|
cp -r static/dist $out/static
|
||||||
cp -r templates $out
|
cp -r templates $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user