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: {},
},
},
server: {},
})