talk_appAmin/vite.config.js

39 lines
917 B
JavaScript
Raw Normal View History

2024-04-23 23:01:35 +08:00
import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import { UnifiedViteWeappTailwindcssPlugin as uvwt } from "weapp-tailwindcss/vite";
const { resolve, WeappTailwindcssDisabled } = require("./shared")
const vitePlugins = [uni(), uvwt({
disabled: WeappTailwindcssDisabled
})];
const postcssPlugins = [
require("autoprefixer")(),
require("tailwindcss")({
config: resolve("./tailwind.config.js"),
}),
];
if (!WeappTailwindcssDisabled) {
postcssPlugins.push(
require("postcss-rem-to-responsive-pixel")({
rootValue: 32,
propList: ["*"],
transformUnit: "rpx",
})
);
}
/**
* @type {import('vite').UserConfig}
*/
export default defineConfig({
build: {
// sourcemap: true,
},
plugins: vitePlugins,
css: {
postcss: {
plugins: postcssPlugins,
},
},
});