vue.config.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. const path = require('path')
  2. const name = 'wanda-adm'
  3. const devServerPort = 28888
  4. const stageServerPort = 28889
  5. module.exports = {
  6. // TODO: Remember to change publicPath to fit your need
  7. publicPath: process.env.NODE_ENV === 'production' ? '/wanda-adm/' : '/',
  8. lintOnSave: process.env.NODE_ENV === 'development',
  9. productionSourceMap: false,
  10. devServer: {
  11. port: devServerPort,
  12. open: true,
  13. overlay: {
  14. warning: false,
  15. errors: true
  16. },
  17. progress: false,
  18. proxy: {
  19. [process.env.VUE_APP_BASE_API]: {
  20. target: `http://127.0.0.1:${stageServerPort}/mock-api/v1`,
  21. changeOrigin: true, // needed for virtual hosted sites
  22. ws: true, // proxy websockets
  23. pathRewrite: {
  24. ['^' + process.env.VUE_APP_BASE_API]: ''
  25. }
  26. }
  27. }
  28. },
  29. pwa: {
  30. name: name
  31. },
  32. pluginOptions: {
  33. 'style-resources-loader': {
  34. preProcessor: 'scss',
  35. patterns: [
  36. path.resolve(__dirname, 'src/styles/_variables.scss'),
  37. path.resolve(__dirname, 'src/styles/_mixins.scss')
  38. ]
  39. }
  40. },
  41. chainWebpack(config) {
  42. // provide the app's title in html-webpack-plugin's options list so that
  43. // it can be accessed in index.html to inject the correct title.
  44. // https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-plugin
  45. config.plugin('html').tap(args => {
  46. args[0].title = name
  47. return args
  48. })
  49. }
  50. }