openks / learn-vue

自定义组件文档
https://openks.github.io/learn-vue
0 stars 0 forks source link

20180820_vuecli3.0使用cdn配置 #117

Open openks opened 6 years ago

openks commented 6 years ago
var chost = '10.10.20.13:8089' 

module.exports = {
  baseUrl:"",
  lintOnSave: false,
  productionSourceMap: false,
  chainWebpack: config => {
    config.externals({
      vue: 'Vue',
      vuex: 'Vuex',
      'vue-router': 'VueRouter',
      'mint-ui': 'window.MINT',
       'element-ui': 'ELEMENT'
    })
  },
  // devServer:{type:Object} 3个属性host,port,https
  // 它支持webPack-dev-server的所有选项
  devServer: {
    port: 8066, // 端口号
    host: 'localhost',
    https: false, // https:{type:Boolean}
    open: true, // 配置自动启动浏览器
    proxy: {
      '/api': {
        target: 'http://' + chost,
        // ws: true,
        changeOrigin: true
      },
    } // 配置多个代理
  }
}