long
10 天以前 7ccdf15645b82b8be8a165b20cbb34294c3f6e9b
config/index.js
@@ -3,7 +3,9 @@
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  dev: {
@@ -20,9 +22,12 @@
        }
      },
      '/api_test': { // 测试环境
        target: 'http://192.168.31.69:8080',
        // target: 'http://192.168.31.69:8080',
        target: 'https://test6.phiskin.com/', // 导医
        // target: 'https://serv3.phiskin.com/', // 导医线上
        // target: 'https://test6.phiskin.com/phi_appt/', // 新预约phis后台
        // target: 'http://hymctest.huoxiongit.com/',// 这个是你服务器开启的接口
        changeOrigin: true,// 是否跨域
        changeOrigin: true, // 是否跨域
        pathRewrite: {
          '^/api_test': ''
        }
@@ -82,5 +87,24 @@
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report
  },
  // 配置使用stylus全局变量
  chainWebpack: config => {
    // set svg-sprite-loader
    config.module
      .rule('svg')
      .exclude.add(resolve('src/icons'))
      .end()
    config.module
      .rule('icons')
      .test(/\.svg$/)
      .include.add(resolve('src/icons'))
      .end()
      .use('svg-sprite-loader')
      .loader('svg-sprite-loader')
      .options({
        symbolId: 'icon-[name]'
      })
      .end()
  }
}