vue.config.js 777 B

123456789101112131415161718192021222324252627282930313233
  1. const webpack = require('webpack')
  2. const path = require('path'); //引入path模块
  3. function resolve(dir) {
  4. return path.join(__dirname, dir) //path.join(__dirname)设置绝对路径
  5. }
  6. //网站title
  7. const name = "醉面美食【唯一官网】"
  8. module.exports = {
  9. chainWebpack: config => {
  10. config.plugin('provide').use(webpack.ProvidePlugin, [{
  11. $: 'jquery',
  12. jquery: 'jquery',
  13. jQuery: 'jquery',
  14. 'window.jQuery': 'jquery'
  15. }]);
  16. },
  17. configureWebpack: {
  18. devServer: {
  19. proxy: {
  20. '/website-api': {
  21. target: 'https://www.hsayi.com',
  22. changeOrigin: true, //是否跨域
  23. // pathRewrite: {
  24. // '^/api': '' //规定请求地址以什么作为开头
  25. // }
  26. }
  27. }
  28. }
  29. }
  30. }