Skip to content

Commit 8531ace

Browse files
committed
adding husky pre commit hooks, chunking some of the deps to reduce individual build file size, updating .gitignore
1 parent 86a064e commit 8531ace

File tree

5 files changed

+35
-1
lines changed

5 files changed

+35
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ node_modules
1111
dist
1212
dist-ssr
1313
*.local
14+
*.tsbuildinfo
1415

1516
# Editor directories and files
1617
.vscode/*

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npm run lint
2+
npm run build

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"lint": "eslint src/",
1010
"format": "prettier --write .",
1111
"format:check": "prettier --check .",
12-
"preview": "vite preview"
12+
"preview": "vite preview",
13+
"prepare": "husky"
1314
},
1415
"dependencies": {
1516
"prismjs": "^1.29.0",
@@ -36,6 +37,7 @@
3637
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
3738
"eslint-plugin-react-refresh": "^0.4.12",
3839
"globals": "^15.9.0",
40+
"husky": "^9.1.7",
3941
"prettier": "^3.4.2",
4042
"typescript": "^5.5.3",
4143
"typescript-eslint": "^8.7.0",

vite.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,17 @@ import tsconfigPaths from "vite-tsconfig-paths";
55
// https://vitejs.dev/config/
66
export default defineConfig({
77
plugins: [react(), tsconfigPaths()],
8+
build: {
9+
rollupOptions: {
10+
output: {
11+
manualChunks: {
12+
prismjs: ["prismjs"],
13+
react: ["react"],
14+
"react-dom": ["react-dom"],
15+
"react-router-dom": ["react-router-dom"],
16+
"react-syntax-highlighter": ["react-syntax-highlighter"],
17+
},
18+
},
19+
},
20+
},
821
});

0 commit comments

Comments
 (0)