add: presentation
This commit is contained in:
35
vite.config.js
Normal file
35
vite.config.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { resolve } from "path";
|
||||
import fs from "fs";
|
||||
|
||||
function getInputs() {
|
||||
const inputs = {
|
||||
main: resolve(__dirname, "index.html"),
|
||||
};
|
||||
|
||||
const entries = fs.readdirSync(__dirname, { withFileTypes: true });
|
||||
|
||||
for (const entry of entries) {
|
||||
if (
|
||||
entry.isDirectory() &&
|
||||
entry.name !== "node_modules" &&
|
||||
entry.name !== "dist" &&
|
||||
!entry.name.startsWith(".")
|
||||
) {
|
||||
const indexPath = resolve(__dirname, entry.name, "index.html");
|
||||
if (fs.existsSync(indexPath)) {
|
||||
inputs[entry.name] = indexPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return inputs;
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: getInputs(),
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user