Skip to content

Commit 4c0dad4

Browse files
authored
Merge pull request #64 from DeskproApps/add-devcontainer
[Chore] Add .devcontainer to improve development consistency across environments
2 parents f5926e7 + 23fcb9d commit 4c0dad4

3 files changed

Lines changed: 40 additions & 1 deletion

File tree

.devcontainer/devcontainer.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "App Container",
3+
"image": "mcr.microsoft.com/devcontainers/javascript-node:latest",
4+
"features": {
5+
"ghcr.io/devcontainers/features/node:1": {
6+
"version": "lts",
7+
"pnpm": "latest"
8+
}
9+
},
10+
"customizations": {
11+
"vscode": {
12+
"settings": {
13+
"terminal.integrated.defaultProfile.linux": "bash",
14+
"editor.tabSize": 2
15+
},
16+
"extensions": [
17+
"dbaeumer.vscode-eslint"
18+
]
19+
}
20+
},
21+
"mounts": [
22+
"source=${localEnv:HOME}/.gitconfig,target=/home/node/.gitconfig,type=bind,consistency=cached",
23+
"source=${localEnv:HOME}/.ssh,target=/home/node/.ssh,type=bind,consistency=cached"
24+
],
25+
"postCreateCommand": "pnpm install"
26+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ build
66
dist-ssr
77
*.local
88
/coverage
9+
.pnpm-store

vite.config.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
1+
import path from "path";
12
import { defineConfig } from "vite";
23
import react from "@vitejs/plugin-react";
34
import copy from "rollup-plugin-copy";
45

6+
const PORT = process.env.VITE_DEV_SERVER_PORT
7+
? parseInt(process.env.VITE_DEV_SERVER_PORT)
8+
: undefined;
9+
510
// https://vitejs.dev/config/
611
export default defineConfig({
712
base: "",
813
plugins: [react()],
914
server: {
15+
host: true,
16+
port: PORT,
1017
allowedHosts: true
1118
},
19+
resolve:{
20+
alias: {
21+
"@": path.resolve(__dirname, "src"),
22+
},
23+
},
1224
build: {
1325
rollupOptions: {
1426
onwarn(warning, warn) {
@@ -29,6 +41,6 @@ export default defineConfig({
2941
],
3042
}),
3143
],
32-
}
44+
},
3345
},
3446
});

0 commit comments

Comments
 (0)