const path = require('path')
const resolve = dir => {
  return path.join(__dirname, dir)
}
module.exports = {
  publicPath: './', // 部署应用包是的基本URL， ./为相对路径
  outputDir: 'dist', // build后生产环境构建文件的目录
  assetsDir: 'static', // 放置生成的静态资源的相对于outputDir的目录
  chainWebpack: config => {
    config.resolve.symlinks(true)
    config.resolve.alias
      .set('_c', resolve('src/components')) // key,value自行定义，比如.set('@@', resolve('src/components'))
  },
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          // modifyVars: {
          //   '@primary-color': '#61ee4b',// 全局主色
          //   '@link-color': '#4f98ee',// 链接色
          // },
          javascriptEnabled: true,
          // globalVars: getLessVariables(resolve("src/styles/variables.less"))
        },
      },
    },
  },
  configureWebpack: {
    externals: {
      "AMap": "AMap"
    }
  }
}
