vue.config.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. const pkg = require('./package.json')
  2. const path = require('path')
  3. const localIP = require('ip').address()
  4. const isPord = process.env.NODE_ENV !== 'development'
  5. const isDev = process.env.NODE_ENV === 'development'
  6. if (isDev) {
  7. process.env.VUE_APP_VERSION = pkg.version + '-' + Date.now()
  8. } else {
  9. process.env.VUE_APP_VERSION = pkg.version
  10. }
  11. const devServer = {
  12. disableHostCheck: true,
  13. headers: {
  14. 'Cache-Control': 'no-store'
  15. },
  16. proxy: {
  17. '/service': {
  18. target: 'https://test.4dkankan.com/',
  19. changeOrigin: true
  20. },
  21. '/smart-site': {
  22. target: 'https://test.4dkankan.com/',
  23. changeOrigin: true
  24. }
  25. }
  26. }
  27. const config = {
  28. assetsDir: 'static',
  29. publicPath: '',
  30. outputDir: 'dist',//isDev ? 'dist' : path.resolve('../../dist/siter'),
  31. productionSourceMap: isDev,
  32. pages: {
  33. 'smart-bim': 'src/pages/bim.js',
  34. 'smart-kankan': 'src/pages/kankan.js',
  35. 'smart-laser': 'src/pages/laser.js',
  36. 'smart-viewer': 'src/pages/viewer.js',
  37. },
  38. css: {
  39. extract: false,
  40. loaderOptions: {
  41. scss: {}
  42. }
  43. },
  44. devServer: devServer,
  45. configureWebpack: {
  46. resolve: {
  47. symlinks: false,
  48. alias: {
  49. vue: path.resolve(`node_modules/vue`)
  50. }
  51. }
  52. }
  53. }
  54. module.exports = config