vue.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. const path = require('path');
  2. const autoprefixer = require('autoprefixer');
  3. const pxtorem = require('postcss-pxtorem');
  4. function resolve(dir) {
  5. return path.join(__dirname, dir)
  6. }
  7. module.exports = {
  8. outputDir: 'dist',
  9. publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
  10. chainWebpack: (config) => {
  11. config.resolve.alias
  12. .set('@$', resolve('src'))
  13. .set('@api', resolve('src/api'))
  14. .set('@assets', resolve('src/assets'))
  15. .set('@views', resolve('src/views'))
  16. },
  17. devServer: {
  18. port: 8082,
  19. proxy: {
  20. '/happyjob': {
  21. target: 'http://kf.hap-job.com', //请求本地 需要happyjob后台项目
  22. ws: false,
  23. changeOrigin: true
  24. },
  25. }
  26. },
  27. css: {
  28. loaderOptions: {
  29. postcss: {
  30. plugins: [
  31. autoprefixer(),
  32. pxtorem({
  33. rootValue: 37.5,
  34. propList: ['*']
  35. })
  36. ]
  37. }
  38. }
  39. },
  40. lintOnSave: undefined
  41. };