mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 01:40:15 +08:00
chore: silence sass import deprecation warnings
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import { fileURLToPath, URL } from 'url';
|
||||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import vuetify from 'vite-plugin-vuetify';
|
||||
import webfontDl from 'vite-plugin-webfont-dl';
|
||||
import { fileURLToPath, URL } from "url";
|
||||
import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import vuetify from "vite-plugin-vuetify";
|
||||
import webfontDl from "vite-plugin-webfont-dl";
|
||||
// @ts-ignore — .mjs not in TS project scope; Vite resolves this at runtime
|
||||
import { runMdiSubset } from './scripts/subset-mdi-font.mjs';
|
||||
import { runMdiSubset } from "./scripts/subset-mdi-font.mjs";
|
||||
|
||||
// Vite plugin: run MDI icon font subsetting (build only)
|
||||
function mdiSubset() {
|
||||
return {
|
||||
name: 'vite-plugin-mdi-subset',
|
||||
name: "vite-plugin-mdi-subset",
|
||||
async buildStart() {
|
||||
console.log('\n🔧 Running MDI icon font subsetting...');
|
||||
console.log("\n🔧 Running MDI icon font subsetting...");
|
||||
await runMdiSubset();
|
||||
},
|
||||
};
|
||||
@@ -21,47 +21,50 @@ function mdiSubset() {
|
||||
export default defineConfig(({ command }) => ({
|
||||
plugins: [
|
||||
// Only run MDI subsetting during production builds, skip in dev server
|
||||
...(command === 'build' ? [mdiSubset()] : []),
|
||||
...(command === "build" ? [mdiSubset()] : []),
|
||||
vue({
|
||||
template: {
|
||||
compilerOptions: {
|
||||
isCustomElement: (tag) => ['v-list-recognize-title'].includes(tag)
|
||||
}
|
||||
}
|
||||
isCustomElement: (tag) => ["v-list-recognize-title"].includes(tag),
|
||||
},
|
||||
},
|
||||
}),
|
||||
vuetify({
|
||||
autoImport: true
|
||||
autoImport: true,
|
||||
}),
|
||||
webfontDl()
|
||||
webfontDl(),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
mermaid: 'mermaid/dist/mermaid.js',
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
mermaid: "mermaid/dist/mermaid.js",
|
||||
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
||||
},
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {}
|
||||
}
|
||||
scss: {
|
||||
api: "modern-compiler",
|
||||
silenceDeprecations: ["import", "global-builtin"],
|
||||
},
|
||||
},
|
||||
},
|
||||
build: {
|
||||
sourcemap: false,
|
||||
chunkSizeWarningLimit: 1024 * 1024 // Set the limit to 1 MB
|
||||
chunkSizeWarningLimit: 1024 * 1024, // Set the limit to 1 MB
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ['vuetify'],
|
||||
entries: ['./src/**/*.vue']
|
||||
exclude: ["vuetify"],
|
||||
entries: ["./src/**/*.vue"],
|
||||
},
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
host: "0.0.0.0",
|
||||
port: 3000,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:6185/',
|
||||
"/api": {
|
||||
target: "http://127.0.0.1:6185/",
|
||||
changeOrigin: true,
|
||||
ws: true
|
||||
}
|
||||
}
|
||||
}
|
||||
ws: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user