import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
// import pxtovw from 'postcss-px-to-viewport'
import { resolve } from 'path';

// const loder_pxtovw = pxtovw({
//   //这里是设计稿宽度 自己修改
//   viewportWidth: 600,
//   viewportUnit: 'vw'
// })
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [uni()],
  resolve: {
    alias: {
      '@': resolve(__dirname, './src')
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@import "@/uni.scss";`
      },
    },
    postcss: {
      // plugins: [loder_pxtovw]
    }
  },
  assetsInclude: '@dcloudio/uni-ui'
});
