mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-27 02:43:15 +00:00
Implement loading dumped data for the handbook
This commit is contained in:
parent
7c4186f5df
commit
12898f6228
3
src/handbook/.gitignore
vendored
3
src/handbook/.gitignore
vendored
@ -22,3 +22,6 @@ dist-ssr
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
|
# Handbook data
|
||||||
|
data/
|
||||||
|
7
src/handbook/data/README.md
Normal file
7
src/handbook/data/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Handbook Data
|
||||||
|
Use Grasscutter's dumpers to generate the data to put here.
|
||||||
|
|
||||||
|
## Files Required
|
||||||
|
- `avatars.json`
|
||||||
|
- `commands.json`
|
||||||
|
- `items.csv`
|
@ -28,6 +28,7 @@
|
|||||||
"vite-tsconfig-paths": "^4.0.7",
|
"vite-tsconfig-paths": "^4.0.7",
|
||||||
"vite-plugin-singlefile": "^0.13.5",
|
"vite-plugin-singlefile": "^0.13.5",
|
||||||
"@vitejs/plugin-react-swc": "^3.0.0",
|
"@vitejs/plugin-react-swc": "^3.0.0",
|
||||||
|
"@rollup/plugin-dsv": "^3.0.2",
|
||||||
|
|
||||||
"sass": "^1.58.3",
|
"sass": "^1.58.3",
|
||||||
"cssnano": "^5.1.15",
|
"cssnano": "^5.1.15",
|
||||||
|
5
src/handbook/src/backend/data.ts
Normal file
5
src/handbook/src/backend/data.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import avatars from "@data/avatars.json";
|
||||||
|
import commands from "@data/commands.json";
|
||||||
|
import items from "@data/items.csv";
|
||||||
|
|
||||||
|
console.log(avatars, commands, items);
|
@ -1,3 +1,8 @@
|
|||||||
declare module "*.svg" {
|
declare module "*.svg" {
|
||||||
export const ReactComponent: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
|
export const ReactComponent: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare module "*.csv" {
|
||||||
|
const content: any[];
|
||||||
|
export default content;
|
||||||
|
}
|
@ -24,7 +24,8 @@
|
|||||||
"@components/*": ["src/ui/*"],
|
"@components/*": ["src/ui/*"],
|
||||||
"@icons/*": ["src/icons/*"],
|
"@icons/*": ["src/icons/*"],
|
||||||
"@views/*": ["src/ui/views/*"],
|
"@views/*": ["src/ui/views/*"],
|
||||||
"@pages/*": ["src/ui/pages/*"]
|
"@pages/*": ["src/ui/pages/*"],
|
||||||
|
"@data/*": ["data/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
|
@ -5,6 +5,7 @@ import { defineConfig } from "vite";
|
|||||||
import react from "@vitejs/plugin-react-swc";
|
import react from "@vitejs/plugin-react-swc";
|
||||||
import tsconfigPaths from "vite-tsconfig-paths";
|
import tsconfigPaths from "vite-tsconfig-paths";
|
||||||
|
|
||||||
|
import dsv from "@rollup/plugin-dsv";
|
||||||
import viteSvgr from "vite-plugin-svgr";
|
import viteSvgr from "vite-plugin-svgr";
|
||||||
import { viteSingleFile } from "vite-plugin-singlefile";
|
import { viteSingleFile } from "vite-plugin-singlefile";
|
||||||
|
|
||||||
@ -12,6 +13,7 @@ import postcss from "./cfg/postcss.config.js";
|
|||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [ react(), tsconfigPaths(), viteSvgr(), viteSingleFile() ],
|
plugins: [ react(), tsconfigPaths(), dsv(),
|
||||||
|
viteSvgr(), viteSingleFile() ],
|
||||||
css: { postcss }
|
css: { postcss }
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user