const {
  defineConfig
} = require('@vue/cli-service')
const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false, //关闭eslint检查
  devServer: {
    host: 'localhost',
    port: '8080',
    open: true,
    hot: true,
    proxy: {
      '/api': {
        target: 'http://127.0.0.1:4523/m1/1100718-0-default',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  },
  publicPath: './',
  chainWebpack: config => {
    config
      .plugin('html')
      .tap(args => {
        args[0].title = '贵州省精品展览展示平台'
        return args
      })
  },
  configureWebpack: config => {
    const configuration = {
      // provide the app's title in webpack's name field, so that
      // it can be accessed in index.html to inject the correct title.
      // name: name,
      resolve: {
        alias: {
          '@': resolve('src')
        }
      }
    }
    return configuration
  },

})
