vue.config.js 599 B

12345678910111213141516171819202122232425262728
  1. 'use strict'
  2. const path = require('path')
  3. function resolve(dir) {
  4. return path.join(__dirname, dir)
  5. }
  6. module.exports = {
  7. publicPath: '/',
  8. outputDir: 'dist',
  9. assetsDir: 'static',
  10. chainWebpack: config => {
  11. config.resolve.alias
  12. .set("@", resolve("src"))
  13. },
  14. devServer: {
  15. proxy: {
  16. '/work': {
  17. target: "http://127.0.0.1:8000",
  18. changeOrigin: true,
  19. pathRewrite: {
  20. '^/work': '/work' //重定向
  21. }
  22. }
  23. }
  24. }
  25. }