vue.config.js 936 B

123456789101112131415161718192021222324252627282930313233343536
  1. const path = require('path');
  2. const frameSrc = path.resolve(__dirname, '../admin-frame');
  3. const packageName = require('./package.json').name;
  4. module.exports = {
  5. publicPath: `/${packageName}/`,
  6. outputDir: path.join(frameSrc, `../../admin-web/${packageName}/`),
  7. devServer: {
  8. port: 3008,
  9. headers: {
  10. 'Access-Control-Allow-Origin': '*'
  11. },
  12. proxy: {
  13. '/api/': {
  14. target: 'http://192.168.0.45:18090'
  15. // target: 'http://127.0.0.1:18090'
  16. },
  17. '/upload/': {
  18. target: 'http://192.168.0.45:9002'
  19. }
  20. }
  21. },
  22. configureWebpack: {
  23. output: {
  24. library: `${packageName}-[name]`,
  25. libraryTarget: 'umd',
  26. jsonpFunction: `webpackJsonp_${packageName}`
  27. },
  28. resolve: {
  29. alias: {
  30. '@components': path.join(frameSrc, '/src/components'),
  31. '@style': path.join(frameSrc, '/style'),
  32. '@lib': path.join(frameSrc, '/lib')
  33. }
  34. }
  35. }
  36. };