vue.config.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. module.exports = {
  2. parallel: false,
  3. productionSourceMap: false,
  4. outputDir: './dist',
  5. publicPath: process.env.VUE_APP_BASE_PUBLIC,
  6. lintOnSave: true,
  7. devServer: {
  8. port: '8080',
  9. disableHostCheck: true,
  10. proxy: {
  11. '^/jydocs': {
  12. target: 'http://192.168.20.180:821',
  13. changeOrigin: true,
  14. logLevel: 'debug',
  15. pathRewrite: {
  16. '^/jydocs': '/jydocs'
  17. }
  18. },
  19. '^/jyintegral': {
  20. target: 'http://192.168.20.145:820',
  21. changeOrigin: true,
  22. logLevel: 'debug',
  23. pathRewrite: {
  24. '^/jyintegral': '/jyintegral'
  25. }
  26. }
  27. }
  28. },
  29. css: {
  30. loaderOptions: {
  31. sass: {
  32. prependData: '@import "@/assets/style/_mixin.scss";@import "@/assets/style/_variables.scss";'
  33. }
  34. }
  35. },
  36. chainWebpack: config => {
  37. if (!process.env.VUE_APP_ALONE) {
  38. config.devServer.set('inline', false)
  39. config.devServer.set('hot', true)
  40. if (process.env.NODE_ENV !== 'production') {
  41. config.output.filename('js/[name].js')
  42. }
  43. config.externals(['vue', 'vue-router'])
  44. }
  45. },
  46. filenameHashing: false
  47. }