1. const path = require('path')
    2. function resolve(dir) {
    3. return path.join(__dirname, dir)
    4. }
    5. module.exports = {
    6. lintOnSave: true,
    7. productionSourceMap: false,
    8. // assetsDir: 'static',
    9. chainWebpack: config => {
    10. config.resolve.alias
    11. .set('@', resolve('src'))
    12. .set('lin', resolve('src/lin'))
    13. .set('assets', resolve('src/asset'))
    14. config.module
    15. .rule('md')
    16. .test(/\.md$/)
    17. .use('vue-loader')
    18. .loader('vue-loader')
    19. .end()
    20. .use('vue-markdown-loader')
    21. .loader('vue-markdown-loader/lib/markdown-compiler')
    22. },
    23. configureWebpack: {
    24. resolve: {
    25. extensions: ['.js', '.json', '.vue', '.scss', '.html'],
    26. },
    27. },
    28. css: {
    29. loaderOptions: {
    30. sass: {
    31. data: '@import "@/assets/style/share.scss";',
    32. },
    33. },
    34. },
    35. devServer: {},
    36. // node_modules依赖项es6语法未转换问题
    37. transpileDependencies: ['vuex-persist'],
    38. devServer: {
    39. open: false, // 是否自动弹出浏览器页面
    40. port: "8888",
    41. https: false,
    42. hotOnly: false,
    43. overlay: {
    44. warnings: true,
    45. errors: true
    46. },
    47. proxy: {
    48. // /api 的意义在于,声明axios中url已/api开头的请求都适用于该规则,
    49. // 注意是以/api开头,即:axios.post({url: '/api/xxx/xxx'})
    50. // "/cms": {
    51. // // target: "http://gaotai.zhuoyuanai.cn/", // API服务器的地址
    52. // target: "https://www.zhuoyuanai.cn", // API服务器的地址
    53. // changeOrigin: true,
    54. // secure: false, // 安全证书 校验
    55. // ws: true, // 是否启用websockets
    56. // headers: { //表示请求的来源(必填)
    57. // Referer: 'https://www.zhuoyuanai.cn'
    58. // },
    59. // pathRewrite: {
    60. // "^/cms": "https://www.zhuoyuanai.cn",
    61. // },
    62. // },
    63. // todo 修改 地址
    64. "/v2": {
    65. target: "https://vegts.cn", // API服务器的地址
    66. changeOrigin: true,
    67. pathRewrite: {
    68. "^/v2": "https://vegts.cn",
    69. }
    70. }
    71. }
    72. }
    73. }