// vue.config.js var path = require("path"); // const BASE_API = "http://10.119.190.12:8000/v1.0" // const proxyUrl = '/v1.0' const BASE_API = "https://test.tall.wiki/datang/v1.0" const proxyUrl = '/datang/v1.0' const port = 8080 module.exports = { // publicPath: '/v1.0/manage', publicPath: '/manage', devServer: { open: true, overlay: { warnings: false, errors: true, }, proxy: { [proxyUrl]: { target: BASE_API, // 代理接口 changeOrigin: true, pathRewrite: { [`^${proxyUrl}`]: '' }, }, }, }, // after(app) { // const baseConfig = require('./babel.config') // require('babel-register')({ // presets: ['es2015'] // }); // const bodyParser = require('body-parser') // // parse app.body // // http://expressjs.com/en/4x/api.html#req.body // app.use(bodyParser.json()) // app.use(bodyParser.urlencoded({ // extended: true // })) // const { default: mocks } = require('./mock') // for (const mock of mocks) { // app[mock.type](mock.url, mock.response) // } // } // }, chainWebpack: config => { //配置 alias config.resolve.alias.set("~", path.resolve(__dirname, './public')) //处理 前端资源的image 都转base64 file-loader config.module .rule('images') .use('url-loader') .loader('url-loader') .tap(options => Object.assign(options, { limit: 10240 })) // html plugin config.plugin('html') .tap(args => { args[0].minify = { removeAttributeQuotes: false // 移除属性的引号 } return args }) } }