vue.config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. '/smart-site': {
  18. target: 'http://192.168.0.38:8011/',
  19. changeOrigin: true
  20. }
  21. }
  22. }
  23. const config = {
  24. assetsDir: 'static',
  25. publicPath: '',
  26. outputDir: 'dist',//isDev ? 'dist' : path.resolve('../../dist/siter'),
  27. productionSourceMap: isDev,
  28. pages: {
  29. 'smart-bim': 'src/pages/bim.js',
  30. 'smart-laser': 'src/pages/laser.js',
  31. 'smart-viewer': 'src/pages/viewer.js',
  32. },
  33. css: {
  34. extract: false,
  35. loaderOptions: {
  36. scss: {}
  37. }
  38. },
  39. devServer: devServer,
  40. configureWebpack: {
  41. resolve: {
  42. symlinks: false,
  43. alias: {
  44. vue: path.resolve(`node_modules/vue`)
  45. }
  46. }
  47. }
  48. }
  49. module.exports = config