1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- import { defineConfig } from "vite";
- import vue from "@vitejs/plugin-vue";
- import path from "path";
- import AutoImport from "unplugin-auto-import/vite";
- import Components from "unplugin-vue-components/vite";
- import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
- import postcsspxtoviewport from "postcss-px-to-viewport";
- export default defineConfig({
- server: {
- open: true,
- prot: 8088,
- },
- resolve: {
-
- alias: {
-
- "~": path.resolve(__dirname, "./"),
-
- "@": path.resolve(__dirname, "./src"),
- },
-
- extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"],
- },
- optimizeDeps: {
-
- include: [
- "@jiaminghi/c-render",
- "@jiaminghi/c-render/lib/plugin/util",
- "@jiaminghi/charts/lib/util/index",
- "@jiaminghi/charts/lib/util",
- "@jiaminghi/charts/lib/extend/index",
- "@jiaminghi/charts",
- "@jiaminghi/color",
- "highcharts",
- "highcharts/highcharts-3d",
- ],
- },
- plugins: [
- vue(),
- AutoImport({
- resolvers: [ElementPlusResolver()],
- }),
- Components({
- resolvers: [ElementPlusResolver()],
- }),
- ],
- css: {
- postcss: {
- plugins: [
- postcsspxtoviewport({
- unitToConvert: "px",
-
- viewportWidth: 3840,
- unitPrecision: 4,
- propList: ["*"],
-
-
- viewportUnit: "vw",
- fontViewportUnit: "vw",
- selectorBlackList: [],
- minPixelValue: 1,
- mediaQuery: true,
- replace: true,
- exclude: [/node_modules\/(?!element-plus)/],
- landscape: false,
- }),
- ],
- },
- },
- });
|