//vue.config.js
const TransformPages = require('uni-read-pages')
const {webpack} = new TransformPages()
module.exports = {
	configureWebpack: {
		plugins: [
			new webpack.DefinePlugin({
				ROUTES: webpack.DefinePlugin.runtimeValue(() => {
					const tfPages = new TransformPages({
						includes: ['path', 'name', 'aliasPath']
					});
					return JSON.stringify(tfPages.routes)
				}, true )
			})
		]
	},
	devServer: {
	    proxy: {
	      '/api': {
	        target: 'http://192.168.3.91:8080',
	        changeOrigin: true,
	        pathRewrite: {
	          '^/api': ''
	        }
	      },
		  '/sapApi': {
		    target: 'http://192.168.3.109:8000',
		    changeOrigin: true,
		    pathRewrite: {
		      '^/sapApi': ''
		    }
		  }
	    },
	}
}