mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-06 02:27:19 +00:00
refactor: build dashboard with vite
This commit is contained in:
parent
f5806932af
commit
aaac328138
45 changed files with 1284 additions and 9668 deletions
40
dashboard/vite.config.ts
Normal file
40
dashboard/vite.config.ts
Normal file
|
@ -0,0 +1,40 @@
|
|||
import { defineConfig, Plugin } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import tailwind from "@tailwindcss/vite";
|
||||
|
||||
function htmlImport(): Plugin {
|
||||
return {
|
||||
name: "html-import",
|
||||
transform(code, id) {
|
||||
if (id.endsWith(".html")) {
|
||||
return {
|
||||
code: `export default ${JSON.stringify(code)};`,
|
||||
map: null,
|
||||
};
|
||||
}
|
||||
return null;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig((configEnv) => {
|
||||
return {
|
||||
server: {
|
||||
port: 3002,
|
||||
host: "0.0.0.0",
|
||||
allowedHosts: true,
|
||||
},
|
||||
plugins: [
|
||||
vue({
|
||||
template: {
|
||||
compilerOptions: {
|
||||
// Needed to prevent hardcoded code blocks from breaking in docs
|
||||
whitespace: "preserve",
|
||||
},
|
||||
},
|
||||
}),
|
||||
tailwind(),
|
||||
htmlImport(),
|
||||
],
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue