vue.config.js 941 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. }
  20. },
  21. css: {
  22. loaderOptions: {
  23. sass: {
  24. prependData: '@import "@/assets/style/_mixin.scss";@import "@/assets/style/_variables.scss";'
  25. }
  26. }
  27. },
  28. chainWebpack: config => {
  29. if (!process.env.VUE_APP_ALONE) {
  30. config.devServer.set('inline', false)
  31. config.devServer.set('hot', true)
  32. if (process.env.NODE_ENV !== 'production') {
  33. config.output.filename('js/[name].js')
  34. }
  35. config.externals(['vue', 'vue-router'])
  36. }
  37. },
  38. filenameHashing: false
  39. }