2 Star 0 Fork 0

Ls-piao/渤海官网

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vite.config.ts 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
lspiao 提交于 2024-08-31 20:42 . feat:完成首页样式调整
declare var require: any;
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path, { resolve } from "path";
// import lessToJs from 'less-vars-to-js';
import stylePxToVw from "./stylePxToVw";
import pxtoviewport from "postcss-px-to-viewport";
const pathResolve = (dir: string): any => {
return resolve(__dirname, ".", dir);
};
// const PACKAGE_PATH = path.join(__dirname, '../../');
// const ROOT_PATH = path.join(PACKAGE_PATH, '../');
// const getPackagePath = (packageName) => path.join(PACKAGE_PATH, `${packageName}`);
// const defaultThemeLess = fs.readFileSync(
// getPackagePath('editor-components/src/style/theme/index.less'),
// );
// const variablesLess = fs.readFileSync(getPackagePath('editor-platform/theme/default/index.less'));
// const defaultPaletteLess = lessToJs(`${variablesLess}${defaultThemeLess}`, {
// stripPrefix: true,
// resolveVariables: false,
// });
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), stylePxToVw()],
define: {
"process.env": {},
},
base: "./",
server: {
port: 9527,
hmr: true,
},
resolve: {
alias: {
"@": pathResolve("./src/"),
},
},
css: {
preprocessorOptions: {
javascriptEnabled: true,
less: {
javascriptEnabled: true,
},
},
postcss: {
plugins: [
pxtoviewport({
unitToConvert: "px",
viewportWidth: 1920,
unitPrecision: 5,
propList: ["*"],
viewportUnit: "vw",
fontViewportUnit: "vw",
selectorBlackList: [],
minPixelValue: 1,
mediaQuery: false,
replace: true,
exclude: [],
landscape: false,
landscapeUnit: "vw",
landscapeWidth: 1280,
}),
],
},
},
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Ls-piao/bohai-official-website.git
git@gitee.com:Ls-piao/bohai-official-website.git
Ls-piao
bohai-official-website
渤海官网
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385