import {
defineConfig
} from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
// @yck-web/vite-plugin-template-inset
const htmlPlugin_ciy = () => {
return {
name: 'html-transform',
transform(code, path) {
if (path.substring(path.length - 4) == '.vue' && path.indexOf('/pages/') > -1) {
// :background-text-style="meta.theme"
let pft = ''; //'';
pft += '';
pft += ''; //暂时只做微信生态
pft += '';
pft += '';
//pft += '';
pft += '';
let pfb = '';
code = code.replace('', '' + pft);
let idx = code.lastIndexOf('');
code = code.slice(0, idx) + pfb + code.slice(idx);
console.log('CiyPlugin:', path);
}
return code;
},
}
}
export default defineConfig({
plugins: [htmlPlugin_ciy(), uni()],
resolve: {
alias: {},
},
css: {
preprocessorOptions: {
// 设置scss全局变量
scss: {},
},
},
<<<<<<< HEAD
server: {},
=======
server: {
// 仅新增这一段代理配置,其他保持不变
port: 5173, // 保留你原本的5173端口
proxy: {
'/ambap': { // 转发/ambap开头的请求到Nginx
target: 'https://labsci.local.ciy.cn', // 你的Nginx域名
changeOrigin: true, // 允许跨域
secure: false // 忽略HTTPS证书校验(本地开发必加)
}
}
},
>>>>>>> 2b53f1cf47e1dea64c20044ab860c92bfd595c2a
})