Switch from esbuild to vite
It just works better for debugging with VueJS
This commit is contained in:
parent
50643698c2
commit
47f900ab76
7 changed files with 610 additions and 665 deletions
23
default.nix
23
default.nix
|
|
@ -5,27 +5,24 @@ let
|
|||
pnpmDeps = pkgs.pnpm.fetchDeps {
|
||||
pname = "nidus-sync-frontend";
|
||||
version = "0.0.11";
|
||||
src ./.;
|
||||
src = ./.;
|
||||
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; # nix will tell you the correct hash
|
||||
};
|
||||
in
|
||||
pkgs.buildGoModule rec {
|
||||
meta = {
|
||||
description = "Nidus Sync";
|
||||
homepage = "https://github.com/Gleipnir-Technology/nidus-sync";
|
||||
};
|
||||
pname = "nidus-sync";
|
||||
src = ./.;
|
||||
subPackages = [];
|
||||
version = "0.0.11";
|
||||
# Needs to be updated after every modification of go.mod/go.sum
|
||||
vendorHash = "sha256-zXjryPAJYpc80cqYtrcp//i6OQi5V5QwhaKQYYfrlL8=";
|
||||
meta = {
|
||||
description = "Nidus Sync";
|
||||
homepage = "https://github.com/Gleipnir-Technology/nidus-sync";
|
||||
};
|
||||
pname = "nidus-sync";
|
||||
src = ./.;
|
||||
subPackages = [];
|
||||
version = "0.0.11";
|
||||
vendorHash = "sha256-zXjryPAJYpc80cqYtrcp//i6OQi5V5QwhaKQYYfrlL8=";
|
||||
|
||||
buildInputs = [ pkgs.proj ];
|
||||
nativeBuildInputs = [
|
||||
pkgs.pkg-config
|
||||
pkgs.dart-sass
|
||||
pkgs.esbuild
|
||||
pkgs.pnpm.configHook
|
||||
pkgs.nodejs
|
||||
];
|
||||
|
|
|
|||
86
flake.nix
86
flake.nix
|
|
@ -1,51 +1,51 @@
|
|||
{
|
||||
description = "Nidus sync";
|
||||
description = "Nidus sync";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
proj.url = "github:Gleipnir-Technology/proj";
|
||||
};
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
proj.url = "github:Gleipnir-Technology/proj";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, proj }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
projPkg = proj.packages.${system}.default;
|
||||
outputs = { self, nixpkgs, flake-utils, proj }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
projPkg = proj.packages.${system}.default;
|
||||
|
||||
# Override pkgs.proj with your custom proj
|
||||
customPkgs = pkgs // {
|
||||
proj = proj.packages.${system}.default;
|
||||
};
|
||||
package = pkgs.callPackage ./default.nix {
|
||||
proj = projPkg;
|
||||
};
|
||||
in
|
||||
{
|
||||
packages.default = package;
|
||||
packages.nidus-sync = package;
|
||||
# Override pkgs.proj with your custom proj
|
||||
customPkgs = pkgs // {
|
||||
proj = proj.packages.${system}.default;
|
||||
};
|
||||
package = pkgs.callPackage ./default.nix {
|
||||
proj = projPkg;
|
||||
};
|
||||
in
|
||||
{
|
||||
packages.default = package;
|
||||
packages.nidus-sync = package;
|
||||
|
||||
# Development shell configuration
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.air
|
||||
pkgs.autoprefixer
|
||||
pkgs.dart-sass
|
||||
pkgs.esbuild
|
||||
pkgs.go
|
||||
pkgs.goose
|
||||
pkgs.gotools
|
||||
pkgs.lefthook
|
||||
# Development shell configuration
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.air
|
||||
pkgs.autoprefixer
|
||||
pkgs.dart-sass
|
||||
pkgs.esbuild
|
||||
pkgs.go
|
||||
pkgs.goose
|
||||
pkgs.gotools
|
||||
pkgs.lefthook
|
||||
pkgs.nodejs
|
||||
pkgs.pkg-config
|
||||
pkgs.pkg-config
|
||||
pkgs.pnpm
|
||||
pkgs.prettier
|
||||
pkgs.prettier-plugin-go-template
|
||||
proj.packages.${system}.default
|
||||
pkgs.typescript
|
||||
pkgs.watchexec
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
pkgs.prettier
|
||||
pkgs.prettier-plugin-go-template
|
||||
proj.packages.${system}.default
|
||||
pkgs.typescript
|
||||
pkgs.watchexec
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
12
index.html
Normal file
12
index.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Nidus Sync</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/ts/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
18
package.json
18
package.json
|
|
@ -14,19 +14,17 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/bootstrap": "^5.2.10",
|
||||
"esbuild": "^0.25.5",
|
||||
"esbuild-plugin-vue3": "^0.5.1",
|
||||
"esbuild-sass-plugin": "^3.7.0",
|
||||
"@vitejs/plugin-vue": "^6.0.5",
|
||||
"sass": "^1.98.0",
|
||||
"typescript": "^5.9.3"
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^8.0.1",
|
||||
"vue-tsc": "^3.2.6"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node build.js",
|
||||
"build:prod": "node build.js --minify",
|
||||
"dev": "pnpm typecheck:watch & pnpm watch",
|
||||
"build": "vite build",
|
||||
"dev": "vite --host --port 8080",
|
||||
"generate-icons": "node generate-icons.js",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"typecheck:watch": "tsc --noEmit --watch --preserveWatchOutput",
|
||||
"watch": "node build.js --watch"
|
||||
"typecheck": "vue-tsc --noEmit",
|
||||
"typecheck:watch": "vue-tsc --noEmit --watch"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1070
pnpm-lock.yaml
generated
1070
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -15,7 +15,7 @@ import { useUserStore } from "@/store/user";
|
|||
|
||||
import Sidebar from "./components/layout/Sidebar.vue";
|
||||
import MainContent from "./components/layout/MainContent.vue";
|
||||
import NavigationLink from "./components/layout/common/NavigationLink.vue";
|
||||
import NavigationLink from "@/components/common/NavigationLink.vue";
|
||||
|
||||
const userStore = useUserStore();
|
||||
onMounted(() => {
|
||||
|
|
|
|||
64
vite.config.ts
Normal file
64
vite.config.ts
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import path from "path";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./ts"),
|
||||
},
|
||||
},
|
||||
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
// Only add this if you have a variables file and need it auto-imported
|
||||
// Comment out or adjust the path if this file doesn't exist or causes issues
|
||||
// additionalData: `@use "@/style/variables.scss" as *;`,
|
||||
|
||||
api: "modern-compiler", // Use the modern Sass API
|
||||
silenceDeprecations: ["import", "global-builtin"],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
build: {
|
||||
manifest: true,
|
||||
outDir: "static/gen",
|
||||
emptyOutDir: true,
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: path.resolve(__dirname, "ts/main.ts"),
|
||||
},
|
||||
output: {
|
||||
entryFileNames: "js/bundle.[hash].js",
|
||||
chunkFileNames: "js/[name].[hash].js",
|
||||
assetFileNames: (assetInfo) => {
|
||||
if (/\.(woff2?|ttf|eot)$/.test(assetInfo.name || "")) {
|
||||
return "fonts/[name].[hash][extname]";
|
||||
}
|
||||
if (/\.css$/.test(assetInfo.name || "")) {
|
||||
return "css/style.[hash][extname]";
|
||||
}
|
||||
return "assets/[name].[hash][extname]";
|
||||
},
|
||||
},
|
||||
},
|
||||
sourcemap: true,
|
||||
},
|
||||
|
||||
server: {
|
||||
allowedHosts: ["poweredge.local", "dev-sync.nidus.cloud"],
|
||||
host: true, // Listen on all addresses
|
||||
port: 8080,
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "http://127.0.0.1:9000",
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
strictPort: true,
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue