二十 vue.config.js

97 阅读1分钟
const TransformPages = require('uni-read-pages')
const {webpack} = new TransformPages()

module.exports = {
	devServer:{
		proxy:{
			'/':{
				"target":'http://uat.banlu.xuexiluxian.cn',
				"changeOrigin":true
			}
		}
	},
	configureWebpack: {
		plugins: [
			new webpack.DefinePlugin({
				ROUTES: webpack.DefinePlugin.runtimeValue(() => {
					const tfPages = new TransformPages({
						includes: ['path', 'name', 'aliasPath']
					});
					return JSON.stringify(tfPages.routes)
				}, true )
			})
		]
	}
}