I'm trying to transition the system I'm

I'm trying to transition the system I'm working on to Vite (from Gulp), following the guide on the community wiki (https://foundryvtt.wiki/en/development/guides/vite). I've followed along as best I can, done a lot of research on the side, and involved my helpful AI copilot as much as possible, but I'm still confused on a few issues. First things first: As part of switching from Gulp to Vite, I've rearranged the folder structure of my dev folder as follows (with a lot left out, of course -- please tell me if I've omitted a file or folder that you want to know the location of):
/systems/euno-blades/
├── dist/
│ ├── (../public/ copied without changes)
│ ├── blades.js
│ └── style.css
├── public/
│ ├── lib/
│ │ └── tagify/
│ ├── system.json
│ └── template.json
├── src/
│ ├── scss/
│ │ └── style.scss
| ├── ts/
| │ ├── @types/
| │ │ └── index.d.ts
| │ └── blades.ts
| ├── index.html // For the Vite dev server
│ └── index.js // For the Vite dev server
├── package.json
├── tsconfig.json
└── vite.config.ts
/systems/euno-blades/
├── dist/
│ ├── (../public/ copied without changes)
│ ├── blades.js
│ └── style.css
├── public/
│ ├── lib/
│ │ └── tagify/
│ ├── system.json
│ └── template.json
├── src/
│ ├── scss/
│ │ └── style.scss
| ├── ts/
| │ ├── @types/
| │ │ └── index.d.ts
| │ └── blades.ts
| ├── index.html // For the Vite dev server
│ └── index.js // For the Vite dev server
├── package.json
├── tsconfig.json
└── vite.config.ts
( Edit: After a few hours of experimentation, I think I figured out many of the issues I was having, so I've cut out the irrelevant stuff --- my current issue is described in the reply to this message. ) Phew. I don't mind telling you I've spent a good hour and a half figuring out how to ask this question in as clear and concise a way as possible, but I admit my brain is shot, lol, so please forgive me if I failed. I'm happy to provide any additional information that might help clarify the issues I'm having --- and if I'm trapped inside an X/Y Problem, I'd be grateful for any guidance on how to reframe my thinking. (Attached thread includes my current vite.config.ts file, for reference.)
1 Reply
Eunomiac
EunomiacOP10mo ago
My vite.config.ts file:
import type { UserConfig } from "vite";
import path from "path";

const config: UserConfig = {
root: "src/",
base: "/systems/eunos-blades/",
publicDir: path.resolve(__dirname, "public"),
server: {
port: 30001,
open: true,
proxy: {
"^(?!/systems/eunos-blades)": "http://localhost:30000/",
"/socket.io": {
target: "ws://localhost:30000",
ws: true
}
}
},
build: {
outDir: path.resolve(__dirname, "dist"),
emptyOutDir: true,
sourcemap: true,
terserOptions: {
mangle: false,
keep_classnames: true,
keep_fnames: true,
},
rollupOptions: {
external: ["gsap/all"]
},
lib: {
name: "blades",
entry: path.resolve(__dirname, "src/ts/blades.ts"),
formats: ["es"],
fileName: "blades"
}
},
resolve: {
alias: {
"gsap/all": path.resolve("D:/LTSC Programs/FoundryVTT/Foundry Virtual Tabletop/resources/app/public/scripts/greensock/esm/all.js")
}
}
};

export default config;
import type { UserConfig } from "vite";
import path from "path";

const config: UserConfig = {
root: "src/",
base: "/systems/eunos-blades/",
publicDir: path.resolve(__dirname, "public"),
server: {
port: 30001,
open: true,
proxy: {
"^(?!/systems/eunos-blades)": "http://localhost:30000/",
"/socket.io": {
target: "ws://localhost:30000",
ws: true
}
}
},
build: {
outDir: path.resolve(__dirname, "dist"),
emptyOutDir: true,
sourcemap: true,
terserOptions: {
mangle: false,
keep_classnames: true,
keep_fnames: true,
},
rollupOptions: {
external: ["gsap/all"]
},
lib: {
name: "blades",
entry: path.resolve(__dirname, "src/ts/blades.ts"),
formats: ["es"],
fileName: "blades"
}
},
resolve: {
alias: {
"gsap/all": path.resolve("D:/LTSC Programs/FoundryVTT/Foundry Virtual Tabletop/resources/app/public/scripts/greensock/esm/all.js")
}
}
};

export default config;
Want results from more Discord servers?
Add your server